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 c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36299

--- Comment #9 from Vincent LefÃvre <vincent at vinc17 dot org> 2011-03-02 15:17:33 UTC ---
(In reply to comment #8)
> Every warning warns about something valid in C, otherwise it would be an error
> not a warning.

No, for instance:

int main(void)
{
  int i;
  return i;
}

This is undefined behavior and detected by GCC, but one gets only a warning:

tst.c: In function âmainâ:
tst.c:4: warning: âiâ is used uninitialized in this function

Compare to a == 0 in the above testcase, which has a well-defined behavior.


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