From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26587 invoked by alias); 26 May 2004 09:00:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26469 invoked by alias); 26 May 2004 09:00:49 -0000 Date: Wed, 26 May 2004 14:38:00 -0000 Message-ID: <20040526090049.26468.qmail@sourceware.org> From: "jsm at polyomino dot org dot uk" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040526021958.15657.paulmoore100@hotmail.com> References: <20040526021958.15657.paulmoore100@hotmail.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/15657] -Wformat diagnostic confusing X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg02973.txt.bz2 List-Id: ------- Additional Comments From jsm at polyomino dot org dot uk 2004-05-26 09:00 ------- Subject: Re: New: -wall incorrectly diagnoses scanf("%a") On Wed, 26 May 2004, paulmoore100 at hotmail dot com wrote: > 3.3.1 (suse 9) 3.2.2 (red hat9) > #include > void f() > { > char *s=0; > scanf("%a", &s); > } > > cc -Wall on this incorrectly produces "float format, pointer arg(arg2)" > it should say "invalid or incomplete format" or something like that What do you think is wrong with the existing message? %a is one of the eight formats for a float (along with %e, %f, %g, %A, %E, %F, %G); C99 subclause 7.19.6.2 paragraphs 12 and 14. There is a glibc extension which conflicts with this, meaning that glibc doesn't conform to C99 in this area (and it doesn't conform to C90 for scanf either), but it only applies when %a is immediately followed by 's', 'S' or '['. Even in those cases it is nonconforming to accept that extension; and, therefore, in C99 mode GCC does not recognise that glibc extension at all in format checking, and hopefully glibc will be fixed in future not to recognise it either in strict C99 mode. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15657