This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15444] Bad warning message in printf format checking


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]