This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15444] Bad warning message in printf format checking
- From: "jsm at polyomino dot org dot uk" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 May 2004 18:18:50 -0000
- Subject: [Bug c/15444] Bad warning message in printf format checking
- References: <20040514180718.15444.james-gcc-bugzilla-501qll3d@and.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm at polyomino dot org dot uk 2004-05-14 18:18 -------
Subject: Re: New: Bad warning message in printf format checking
On Fri, 14 May 2004, james-gcc-bugzilla-501qll3d at and dot org wrote:
> The format can contain either numbered argument conversion specifications (that
> is, "%n$" and "*m$"), or unnumbered argument conversion specifications (that is,
> % and * ), but not both.
>
> ...however glibc does work in this mode, as do a number of other implementations
> of printf.
This must be some strange meaning of "work" - far from documenting any
meaning for which argument an unnumbered specifier takes if there are also
numbered ones (next from the start, or from the previous numbered one?),
the glibc manual expressly repeats that it is undefined:
# If any of the formats has a specification for the parameter position all
# of them in the format string shall have one. Otherwise the behavior is
# undefined.
The diagnostics could however be improved to check for $ argument numbers
when it is known they must not appear and give a more specific diagnostic.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15444