This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -Wall incorrectly complains about scanf with %a
- From: Eljay Love-Jensen <eljay at adobe dot com>
- To: paul moore <paulmoore100 at hotmail dot com>, gcc-help at gcc dot gnu dot org
- Date: Tue, 25 May 2004 19:04:52 -0500
- Subject: Re: -Wall incorrectly complains about scanf with %a
- References: <Sea2-DAV9p1nF9hOdYs000224be@hotmail.com>
Hi Paul,
I agree with you that the compiler's complaint is incorrect.
"%a" isn't a valid format specifier.
"%as" is a valid format specifier, and it takes an address of an
uninitialized char pointer, which will be set to a malloc'd value
sufficient to hold the character array.
Also note (http://www.rt.com/man/scanf.3.html), the "a" modifier is not
part of ANSI C. It's a GNU libc extension.
Good catch! File a bug.
--Eljay