[cfe-dev] Generating printf format specifiers
Jens Ayton
mailing-lists.jens at ayton.se
Sun Jan 24 01:16:28 PST 2010
On Jan 22, 2010, at 19:35, Dave Keck wrote:
>
>
> I imagine __nsfmt__ would work similarly to __typeof__, but rather than substituting the type, the compiler would substitute the most natural printf format specifier for the given type. There would also be a standard-C __fmt__ that would generate constant C-strings rather than constant NSStrings.
As a side note, it wouldn't actually be necessary to make this distinction if __fmt__() was semantically treated as a string literal, since you can concatenate C string literals to ObjC ones:
@"Hello, " "World"
@"Hello, " __fmt__(userName) "!"
#define __nsfmt__(x) @__fmt__(x)
--
Jens Ayton
More information about the cfe-dev
mailing list