[cfe-commits] [Patch] -Wformat-non-standard: warn about positional arguments (pr12017)

Ted Kremenek kremenek at apple.com
Mon Feb 27 12:00:25 PST 2012


On Feb 27, 2012, at 9:56 AM, Hans Wennborg <hans at chromium.org> wrote:

> On Mon, Feb 27, 2012 at 16:54, Joerg Sonnenberger
> <joerg at britannica.bec.de> wrote:
>> On Mon, Feb 27, 2012 at 03:09:05PM +0000, Hans Wennborg wrote:
>>> The attached patch makes -Wformat-non-standard warn about the use of
>>> positional arguments (e.g. "%3$d") in format strings. (pr12017)
>> 
>> It sounds wrong to use -Wformat-non-standard for those, since they are
>> covered by POSIX.
> 
> Looking at http://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html,
> it seems that so are the 'S' and 'C' conversion specifiers.
> 
> Do you have a better name suggestion for the flag?
> 
> The intention was that it should mean "non-standard" as in "non ISO C standard".

For me the goal of the warning is to warn about non-portable code, not annoy people.  Format specifiers and format string extensions covered by POSIX are by definition portable on POSIX-compliant systems.  So I raise the question of whether or not we should warn about these at all?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120227/17af6c14/attachment.html>


More information about the cfe-commits mailing list