<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 20, 2012, at 2:09 PM, Jean-Daniel Dupas wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">Actually, clang automatically add a "format(printf)" attribute to the declarations of NSLog/NSLogv functions.<br>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,<br>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.<br><br>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.<br></span></blockquote><div><br></div>Makes sense.</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><br>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).<br></span></blockquote><br></div><div>No need.  NSLog only makes sense in ObjC, since the format string is an NSString, not a C string.  Just keep it simple.</div><br></body></html>