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

Hans Wennborg hans at chromium.org
Thu Mar 8 02:13:11 PST 2012


On Wed, Mar 7, 2012 at 19:35, Ted Kremenek <kremenek at apple.com> wrote:
> Hi Hans,
>
> I think I only have a minor nit:
>
> +  "the '%0' %1 is not supported by ISO C">, InGroup<FormatNonStandard>, DefaultIgnore;
>
> It seems weird to start a diagnostic with "the".  Why include it?  Dropping it changes:
>
>  the 'q' length modifier is not supported by ISO C
>
> to
>
>  'q' length modifier is not supported by ISO C
>
> The second seems just fine for a warning.
Agreed.


> We can also probably be a bit more succinct with this diagnostic:
>
>  "using the length modifier '%0' with the conversion specifier '%1' is not supported by ISO C"
>
> can instead be:
>
>  "using length modifier '%0' with conversion specifier '%1' is not supported by ISO C"
>
> The second wording is more direct, and a bit more clinical, but the more verbose version doesn't add much value and just makes the warning longer.
Done.

New patch attached. OK to commit?
The clang-tests suite will need a small update because of the
re-wording of the warnings. (Attached.)

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: positional-arguments-warning3.diff
Type: application/octet-stream
Size: 13017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120308/e630a1b6/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-tests.diff
Type: application/octet-stream
Size: 781 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120308/e630a1b6/attachment-0001.obj>


More information about the cfe-commits mailing list