This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/56977] gcc -Og incorrectly warns about 'constant zero length parameter'


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]