[cfe-commits] [Patch] -Wformat: warn about using length modifiers with %n

Stephen Canon scanon at apple.com
Thu Aug 2 10:57:45 PDT 2012

On Aug 2, 2012, at 1:47 PM, Matt Beaumont-Gay <matthewbg at google.com> wrote:

> On Thu, Aug 2, 2012 at 10:31 AM, Ted Kremenek <kremenek at apple.com> wrote:
>> C99 says you can use %n with the length modifiers 'hh', 'h', 'l', 'j', 'z', and 't'.
> Oh, so it does. I believe that's new in C99 though.

I don't think anything in C99 qualifies as "new" at this point.  That aside, 'h' and 'l' were supported with %n in C89, and the other modifiers didn't exist yet.

"The conversion specifiers d, i , and n shall be preceded by h if the corresponding argument is a pointer to short int rather than a pointer to int , or by l if it is a pointer to long int ."

- Steve

More information about the cfe-commits mailing list