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: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 2 Mar 2011 17:06:51 +0000
- Subject: [Bug c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array
- Auto-submitted: auto-generated
- References: <bug-36299-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36299
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2011.03.02 17:06:47
Ever Confirmed|0 |1
--- Comment #10 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2011-03-02 17:06:47 UTC ---
(In reply to comment #9)
> This is undefined behavior and detected by GCC, but one gets only a warning:
I am not going to waste time discussing the fine-points of what is a valid C
program. If you don't want this warning, please contribute a testcase to
gcc-patches@gcc.gnu.org, so this warning won't reappear in the future:
http://gcc.gnu.org/wiki/HowToPrepareATestcase
Otherwise, someone will come who thinks that this should be warned and they
will "fix it".