http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60759
--- Comment #3 from Giuliano Procida <giuliano.procida at googlemail dot com>
---
I believe the clang warning is:
foo.c:1:18: warning: use of logical '||' with constant operand
[-Wconstant-logical-operand]
static int x = 2 || 3;
^ ~
foo.c:1:18: note: use '|' for a bitwise operation
static int x = 2 || 3;
^~
|
1 warning generated.
However, changing the code to:
int two() { return 2; }
int three() { return 3; }
int main() {
int x = two() || three();
return x;
}
results in no warnings from either compiler (in either language).