public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5310: Wierd warnings about using (int)NULL
@ 2002-09-15 12:25 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-15 12:25 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, suckfish

Synopsis: Wierd warnings about using (int)NULL

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 12:25:11 2002
State-Changed-Why:
    confirmed.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5310


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

* c++/5310: Wierd warnings about using (int)NULL
@ 2002-01-07 22:46 suckfish
  0 siblings, 0 replies; 2+ messages in thread
From: suckfish @ 2002-01-07 22:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5310
>Category:       c++
>Synopsis:       Wierd warnings about using (int)NULL
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jan 07 22:46:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     suckfish@ihug.co.nz
>Release:        3.0.3
>Organization:
>Environment:
Debian GNU Linux, i686.
Debian gcc package gcc-3.0-3.0.3-1
>Description:
The attached file, compiled with g++ -Wall generates:

temp.cc: In function `void bar()':
temp.cc:8: warning: passing NULL used for non-pointer argument passing 1 of 
   `void foo(int)'
temp.cc:8: warning: argument to non-pointer type `int' from NULL

I think the warning message is bogus.  The argument expression has been cast to an int, so the compiler should not warn about using it as an int argument.

If it is decided that the warning message from line 8 is in fact correct, then line 9 should also give a warning (using NULL as a long is just as silly as using NULL as an int).
>How-To-Repeat:
Compile attached file with g++ -Wall
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="temp.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="temp.cc"

Ly8gQ29tcGlsZSBhcyBDKysgd2l0aCAtV2FsbAojaW5jbHVkZSA8c3RkbGliLmg+Cgp2b2lkIGZv
byAoaW50KTsKdm9pZCBmb28gKGxvbmcpOwoKdm9pZCBiYXIoKQp7CiAgIGZvbyAoKGludClOVUxM
KTsKICAgZm9vICgobG9uZylOVUxMKTsKfQo=


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

end of thread, other threads:[~2002-09-15 19:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-15 12:25 c++/5310: Wierd warnings about using (int)NULL nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-01-07 22:46 suckfish

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