public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/36299] spurious and undocumented warning with -Waddress for a == 0 when a is an array
Date: Wed, 02 Mar 2011 10:52:00 -0000	[thread overview]
Message-ID: <bug-36299-4-DoF1MAj53H@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-36299-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #8 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-03-02 10:51:51 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > I think the intention is to warn, at least for a == (void *)0, since the
> > address of a cannot be zero or null. So I would say that this is a regression.
> 
> But this is valid in C, and in practice, such a test can occur in macro
> expansions: a macro can check whether some pointer is null before doing
> something with it. There shouldn't be a warning in such a case.

Every warning warns about something valid in C, otherwise it would be an error
not a warning.


  parent reply	other threads:[~2011-03-02 10:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-36299-4@http.gcc.gnu.org/bugzilla/>
2011-03-01  9:14 ` manu at gcc dot gnu.org
2011-03-01 15:05 ` vincent at vinc17 dot org
2011-03-01 15:37 ` manu at gcc dot gnu.org
2011-03-02  1:15 ` vincent at vinc17 dot org
2011-03-02 10:52 ` manu at gcc dot gnu.org [this message]
2011-03-02 15:17 ` vincent at vinc17 dot org
2011-03-02 17:06 ` manu at gcc dot gnu.org
2011-03-11 15:15 ` vincent-gcc at vinc17 dot net
2011-04-01 19:36 ` jsm28 at gcc dot gnu.org
2014-06-30 19:38 ` mpolacek at gcc dot gnu.org
2008-05-22  9:05 [Bug c/36299] New: " vincent at vinc17 dot org
2008-05-22 20:01 ` [Bug c/36299] " pinskia at gcc dot gnu dot org
2008-08-23 12:55 ` manu at gcc dot gnu dot org
2008-08-23 20:01 ` vincent at vinc17 dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-36299-4-DoF1MAj53H@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).