public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/52718] New: -Wzero-as-null-pointer-constant: misleading location for 0 as default argument
@ 2012-03-26  8:18 akim.demaille at gmail dot com
  2012-03-29 10:11 ` [Bug c++/52718] " paolo.carlini at oracle dot com
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: akim.demaille at gmail dot com @ 2012-03-26  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52718
           Summary: -Wzero-as-null-pointer-constant: misleading location
                    for 0 as default argument
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: akim.demaille@gmail.com


Created attachment 26990
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26990
0 instead of nullptr as default argument

I don't think this is a duplicated of 51196.

In the following example, the locations about the uses of 0
instead of nullptr are misleading: none point to the real
issue, but they point to where the default argument was used.

$ g++-mp-4.8 -Wzero-as-null-pointer-constant -c /tmp/foo.cc
/tmp/foo.cc: In constructor 'bar::bar()':
/tmp/foo.cc:10:9: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
/tmp/foo.cc: At global scope:
/tmp/foo.cc:15:27: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
/tmp/foo.cc:16:22: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]

$ g++-mp-4.8 --version
g++-mp-4.8 (GCC) 4.8.0 20120318 (experimental)
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


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

end of thread, other threads:[~2015-03-05 21:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26  8:18 [Bug c++/52718] New: -Wzero-as-null-pointer-constant: misleading location for 0 as default argument akim.demaille at gmail dot com
2012-03-29 10:11 ` [Bug c++/52718] " paolo.carlini at oracle dot com
2012-03-29 10:25 ` paolo.carlini at oracle dot com
2012-03-29 10:43 ` paolo.carlini at oracle dot com
2012-03-29 16:32 ` jason at gcc dot gnu.org
2012-03-29 17:08 ` paolo.carlini at oracle dot com
2012-03-29 17:39 ` paolo.carlini at oracle dot com
2012-03-29 23:22 ` paolo.carlini at oracle dot com
2012-03-29 23:22 ` paolo at gcc dot gnu.org
2012-03-30  0:29 ` paolo at gcc dot gnu.org
2012-11-01  0:38 ` mw_triad at users dot sourceforge.net
2012-11-01  1:28 ` paolo.carlini at oracle dot com
2012-11-01 17:47 ` mw_triad at users dot sourceforge.net
2012-11-01 17:57 ` mw_triad at users dot sourceforge.net
2012-11-01 19:07 ` paolo.carlini at oracle dot com
2012-11-01 20:52 ` paolo.carlini at oracle dot com
2012-11-01 22:04 ` mwoehlke.floss at gmail dot com
2012-11-01 22:42 ` paolo.carlini at oracle dot com
2012-11-01 23:01 ` manu at gcc dot gnu.org
2012-11-01 23:05 ` mw_triad at users dot sourceforge.net
2012-11-01 23:24 ` manu at gcc dot gnu.org
2015-03-05 21:03 ` paolo.carlini at oracle dot com

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