[cfe-commits] [Patch] Warn about non-standard format strings (PR12017)

Joerg Sonnenberger joerg at britannica.bec.de
Mon Feb 20 11:35:14 PST 2012


On Mon, Feb 20, 2012 at 11:02:25AM -0800, Ted Kremenek wrote:
> (1) Warn about non-standard format strings only when it is an issue
> for the target platform.  This is hard to do, but this is basically
> what users will expect.

IMO most of the format extensions are of questionable value (%m),
outdated historic extensions (q modifier) or just plainly unportable (S
modifier). Allowing them by default makes it a lot easier to slip them
unintentionally in for no real value in case of the first two
categories. The third category is even more painful since it can require
extensive code changes. Worse, even a single target playform is not
necessarily consistent. Consider 'a' handling for scanf. Many embeddeed
systems use Linux with uClibc -- which doesn't implement it. How do you
detect if the libc support it or not?

Joerg



More information about the cfe-commits mailing list