[Bug middle-end/56977] gcc -Og incorrectly warns about 'constant zero length parameter'
harald at gigawatt dot nl
gcc-bugzilla@gcc.gnu.org
Sat Jun 15 09:59:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56977
--- Comment #2 from Harald van Dijk <harald at gigawatt dot nl> ---
Inlining isn't relevant:
__attribute__((__error__("error"))) void error ();
void f (int i) {
if (__builtin_constant_p (i)) {
error ();
}
}
fails the same way. But it doesn't fail with all uses of __builtin_constant_p:
__attribute__((__error__("error"))) void error ();
void f () {
int g ();
if (!__builtin_constant_p (1)) {
error ();
}
if (__builtin_constant_p (g ())) {
error ();
}
}
compiles without any problems.
More information about the Gcc-bugs
mailing list