This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2008 20:00:48 -0000
- Subject: [Bug c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array
- References: <bug-36299-6373@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from pinskia at gcc dot gnu dot org 2008-05-22 20:00 -------
if (a == 0)
return 1;
else if (a == (void *) 0)
Those two should warn about being address being zero. "a" decays to a pointer
type and really &a[0].
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36299