On Tue, 9 May 2017, Aurelien Jarno wrote:
| main.c: In function 'print_fpscr_settings':
| main.c:73:26: warning: suggest parentheses around comparison in operand of 
'&' [-Wparentheses]
|          if ((fpscr >> i) & 0x1 == 1) {
|                           ^

Actually the compiler is correct here, this should be:

if ((fpscr >> i & 0x1) == 1) {

or even just

if (fpscr >> i & 1) {

because & is lower priority than == but the result may still be the same by chance if 0x1 == 1 is always 1 and ANDing the shifted value with this is either 0 or 1 so it may give the correct result but not the way one would think looking at the expression.

Regards,
BALATON Zoltan

Reply via email to