|
|
|
|
|
by __david__
2555 days ago
|
|
For the same reason that this: if (c)
printf("Hello");
exit(0);
exit(1);
Produces a warning in gcc: test.c:7:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (c)
^~
test.c:9:9: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
exit(0);
^~~~
"2^32" is of course just an xor, but it makes no sense (the "exclusive" part of it is not being exercised). If you really mean 2 bits being set in a constant then "2 | 32" is much clearer. If you're dead set on xor, "32^2" won't trigger the warning. |
|
Stating that 32^2 should not trigger a warning while 2^32 should shows that this proposal has not been thought through.
It's not desirable or sensible to raise a warning on the premise that the expression might mean something else in another language, which is what this would do.