public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/30860]  New: Should warn about boolean constant false used in pointer context
@ 2007-02-19 15:27 rguenth at gcc dot gnu dot org
  2007-02-19 16:44 ` [Bug c++/30860] " mueller at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-19 15:27 UTC (permalink / raw)
  To: gcc-bugs

void foo(const char *); 
void bar() { foo(false); }

should warn that 'false' is interpreted as NULL pointer constant and as such
is convertible to const char *.  (Through false -> (int)0 -> NULL -> (const
char *)0)

As foo(true) is (rightfully) rejected the case above is usually not intended.

See 4.10.


-- 
           Summary: Should warn about boolean constant false used in pointer
                    context
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


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

end of thread, other threads:[~2007-03-14 23:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-19 15:27 [Bug c++/30860] New: Should warn about boolean constant false used in pointer context rguenth at gcc dot gnu dot org
2007-02-19 16:44 ` [Bug c++/30860] " mueller at gcc dot gnu dot org
2007-02-19 19:01 ` pinskia at gcc dot gnu dot org
2007-02-19 19:14 ` manu at gcc dot gnu dot org
2007-02-19 19:48 ` gdr at cs dot tamu dot edu
2007-02-19 19:59 ` gdr at cs dot tamu dot edu
2007-02-19 20:21 ` mueller at gcc dot gnu dot org
2007-02-19 20:23 ` mueller at gcc dot gnu dot org
2007-02-19 20:50 ` gdr at cs dot tamu dot edu
2007-02-19 20:50 ` manu at gcc dot gnu dot org
2007-02-20  9:53 ` rguenth at gcc dot gnu dot org
2007-03-14 23:17 ` mueller at gcc dot gnu dot org
2007-03-14 23:20 ` mueller 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).