Le 20 janv. 2012 à 23:44, Eli Friedman a écrit : > On Fri, Jan 20, 2012 at 2:09 PM, Jean-Daniel Dupas > <[email protected]> wrote: >> Hi, >> >> Actually, clang automatically add a "format(printf)" attribute to the >> declarations of NSLog/NSLogv functions. >> This is actually wrong, as NSLog expect an NSString format attribute. It is >> not really an issue as the code that checks the format string is the same >> for printf and NSString, >> but actually I'm working on adding support for CFString format, and having >> the wrong tag on NSLog functions prevent some code factoring between >> CFString and NSString format checking. >> >> Now that NSString format is properly checked, this trick is no longer >> needed, so I'd like to stop forcing the type to printf, and use NSString >> instead. >> >> This patch also reduce the scope of this hack to objc code only (so if by >> any change someone write a C library with an NSLog function, clang will not >> try to tag it with an NSString format attribute). > > If you're going to be in the area anyway, can you get rid of the hack > altogether and add definitions of these functions into Builtins.def? > These functions shouldn't need any special logic. > > -Eli
I have nothing against completely removing this hack, especially as these functions are properly declared in the Foundation headers, but is it worth putting a definition in Builtins.def ? Unlike other objc functions defined in Builtins.def, NSLog functions are not part of the runtime. -- Jean-Daniel _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
