From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23259 invoked by alias); 8 Jan 2002 06:46:08 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 23204 invoked by uid 71); 8 Jan 2002 06:46:03 -0000 Resent-Date: 8 Jan 2002 06:46:02 -0000 Resent-Message-ID: <20020108064602.23203.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, suckfish@ihug.co.nz Received:(qmail 22168 invoked by uid 61); 8 Jan 2002 06:42:04 -0000 Message-Id:<20020108064204.22164.qmail@sources.redhat.com> Date: Mon, 07 Jan 2002 22:46:00 -0000 From: suckfish@ihug.co.nz Reply-To: suckfish@ihug.co.nz To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/5310: Wierd warnings about using (int)NULL X-SW-Source: 2002-01/txt/msg00323.txt.bz2 List-Id: >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=