[cfe-dev] [PATCH] Let __attribute__((format(…))) accept OFStrings

Jonathan Schleifer js at webkeks.org
Wed Nov 27 11:47:37 PST 2013


Am 27.11.2013 um 18:16 schrieb David Chisnall <David.Chisnall at cl.cam.ac.uk>:

> You can only have one format of constant string per compilation unit, so this doesn't seem important.  The type of the constant string argument is something that is defined by the parameter type, it doesn't need to be part of the printf extension format.  
> 
> Instead, you want to be able to define printf-like method sets, and then attach these to methods as you currently do with the standard printf-like things.

You are right, it would be possible to just allow the printf format string type for all constant strings, either C strings or ObjC strings or C(++)11 char{16,32}_t literals, or even wchar_t. Or C++11 custom string literals. That would make __NSString__ and __OFString__ unnecessary and just allow format(printf, …) for all of them. I think this is a cleaner solution and the way to go!

--
Jonathan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131127/15a6d5e8/attachment.sig>


More information about the cfe-dev mailing list