Author: dcoughlin Date: Fri May 6 13:13:30 2016 New Revision: 268768 URL: http://llvm.org/viewvc/llvm-project?rev=268768&view=rev Log: [www][analyzer] Update recommended suppression mechanism for localization.
Based on feedback from Jordan Rose, make the recommended suppression function be 'static inline'. Modified: cfe/trunk/www/analyzer/faq.html Modified: cfe/trunk/www/analyzer/faq.html URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/www/analyzer/faq.html?rev=268768&r1=268767&r2=268768&view=diff ============================================================================== --- cfe/trunk/www/analyzer/faq.html (original) +++ cfe/trunk/www/analyzer/faq.html Fri May 6 13:13:30 2016 @@ -84,10 +84,10 @@ You can add <tt>__attribute__((unused))< <p>When the analyzer sees that an unlocalized string is passed to a method that will present that string to the user, it is going to produce a message similar to this one: <pre class="code_example">User-facing text should use localized string macro</pre> -If your project deliberately uses unlocalized user-facing strings (for example, in a debugging UI that is never shown to customers), you can suppress the analyzer warnings (and document your intent) with a function that just returns its input but is annotated to return a localized string: +If your project deliberately uses unlocalized user-facing strings (for example, in a debugging UI that is never shown to users), you can suppress the analyzer warnings (and document your intent) with a function that just returns its input but is annotated to return a localized string: <pre class="code_example"> __attribute__((annotate("returns_localized_nsstring"))) -NSString *LocalizationNotNeeded(NSString *s) { +static inline NSString *LocalizationNotNeeded(NSString *s) { return s; } </pre> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits