Reputation: 3
I get this warning if I try to run the code:
warning: expression result unused [-Wunused-value]
!!(((x&0xff)
| ((x >> 8) & 0xff)
| ((x >> 16) & 0xff)
| ((x >> 24) & 0xff))
& 0xaa);
return (x & 0xaaaaaaaa) != 0;
The code works fine. I just want to know why the warning is being generated.
Upvotes: 0
Views: 37
Reputation: 26066
This statement:
!!(((x&0xff)
| ((x >> 8) & 0xff)
| ((x >> 16) & 0xff)
| ((x >> 24) & 0xff))
& 0xaa);
has no effect because you don't assign the result and there are no side-effects either.
Upvotes: 3