From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21516 invoked by alias); 29 Dec 2002 00:38:36 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 21506 invoked from network); 29 Dec 2002 00:38:33 -0000 Received: from unknown (HELO suneidesis.com) (213.208.87.130) by 209.249.29.67 with SMTP; 29 Dec 2002 00:38:33 -0000 Received: from localhost (trevor@localhost) by suneidesis.com (8.9.3/8.9.3) with ESMTP id AAA15037 for ; Sun, 29 Dec 2002 00:38:21 GMT Date: Sat, 28 Dec 2002 19:50:00 -0000 From: Trevor Jenkins X-X-Sender: trevor@suneidesis To: Gnu Compiler Collection Hackers Subject: Re: [GCC] Re: Bizarre warning about width of argument In-Reply-To: Message-ID: X-Archive: expiry=0 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-12/txt/msg01512.txt.bz2 On Thu, 26 Dec 2002, Russ Allbery wrote: > Trevor Jenkins writes: > > > When the following example is compiled we get a warning: > > > foo.c: In function `foo': > > foo.c:8: warning: passing arg 1 of `bar' with different width due to prototype > > > gcc -c -ansi -fno-nonansi-builtins -Wshadow -Wconversion foo.c > > The warning is correct for what -Wconversion is for. You probably don't > want to use this flag with regular programs. Thank you; yes that fixed that issue with the test case. However, there is another issue which can also be demonstrated with a near identical test case: #include void foo(unsigned short); void bar(unsigned short); void foo(unsigned short index) { bar(index); } void bar(unsigned short a) { } the gcc options are slightly different but closer to those used in the actual system: gcc -c -fno-builtin -Wshadow foo.c producing riley.c:6: warning: declaration of `index' shadows global declaration riley.c: In function `foo': riley.c:7: warning: declaration of `index' shadows global declaration The function "index" is not defined in the C standard. However, it is mentioned in the string.h include file. So the question is how do we suppress the warning for non-standard functions whilst retaining the warning for functions defined in the standard? Regards, Trevor British Sign Language is not inarticulate handwaving; it's a living language. Support the campaign for formal recognition by the British government now! Details at http://www.fdp.org.uk/ -- <>< Re: deemed!