[PATCH] Accept %k format specifier

David Majnemer david.majnemer at gmail.com
Sat Nov 23 20:08:32 PST 2013


On Sat, Nov 23, 2013 at 1:15 PM, Jonathan Schleifer <js at webkeks.org> wrote:

> Am 23.11.2013 um 21:15 schrieb David Majnemer <david.majnemer at gmail.com>:
>
> > I see no tests in your patch, please add a test.
>
> Ok, will add one.
>
> > Also, you seem to allow %k/%K in any context, not just ones where
> ObjCRuntime::getKind() == ObjFW.  Please fix this.
>
> This is intentional! ObjFW is by no means limited to the ObjFW runtime,
> you can use it perfectly fine with the Apple runtime. This is also not
> limited to ObjC, as in .c files you can also use function like of_asprintf
> which accept these format specifiers. So while it might be debatable
> whether to limit it to ObjC files, limiting it to only the ObjFW runtime
> will result in code that compiles when using ObjFW with the ObjFW runtime,
> but is rejected by Clang with -Werror with the Apple runtime.
>

We cannot enable this unconditionally. The vast majority of users will not
be using ObjFW, allowing %k in all conditions may hide diagnostics that
would be useful. It is also a potential problem if POSIX/IEEE Std 1003.1
chose to use 'k'/'K' for something.

>
> --
> Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131123/f383ca52/attachment.html>


More information about the cfe-commits mailing list