public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/43906]  New: missing warnings the comparison between an address with a null pointer constant
@ 2010-04-27  3:30 pzhao at gcc dot gnu dot org
  2010-04-27  7:27 ` [Bug c++/43906] " manu at gcc dot gnu dot org
  0 siblings, 1 reply; 3+ messages in thread
From: pzhao at gcc dot gnu dot org @ 2010-04-27  3:30 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 936 bytes --]

As Manuel mentioned at http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01425.html.
C++ have the same problem as pr32207.

extern void z();
void f() { if ( z ) z(); }
void g() { if ( z != 0 ) z(); }
void h() { if ( z != (void*)0 ) z(); }

t.C: In function ‘void f()’:
t.C:2:19: warning: the address of ‘void z()’ will always evaluate as ‘true’
[-Waddress]
t.C: In function ‘void g()’:
t.C:3:22: warning: the address of ‘void z()’ will never be NULL [-Waddress]


-- 
           Summary: missing warnings the comparison between an address with
                    a null pointer constant
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pzhao at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-06 19:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43906-4@http.gcc.gnu.org/bugzilla/>
2014-08-06 19:09 ` [Bug c++/43906] missing warnings the comparison between an address with a null pointer constant paolo at gcc dot gnu.org
2014-08-06 19:11 ` paolo.carlini at oracle dot com
2010-04-27  3:30 [Bug c++/43906] New: " pzhao at gcc dot gnu dot org
2010-04-27  7:27 ` [Bug c++/43906] " manu at gcc dot gnu dot org

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).