------- Comment #5 from joseph at codesourcery dot com 2009-05-14 12:01 ------- Subject: Re: spurious format string warnings
On Thu, 14 May 2009, bje at gcc dot gnu dot org wrote: > Andrew wrote: > > "GCC can assume %qE means anything from just printing E in quotes" > > Can you explain this? Is it really the case that the format specifier can > have > an optional argument? This is not a meaningful question. There are no limits on the possible semantics of a format string; a variadic function can apply arbitrary Turing-complete computations to its fixed arguments to determine the types of the variable arguments, and to the first N variable arguments to determine the type of argument N+1. GCC can only warn about strings not following the rules for a particular type of format that were built into GCC; if you compile code with a string intended for different, newer rules, as here, it cannot have any idea what the newer rules are and thus whether %E takes no arguments (like %%), one, two or more. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40065