diff options
author | Devin Coughlin <dcoughlin@apple.com> | 2016-05-06 18:13:30 +0000 |
---|---|---|
committer | Devin Coughlin <dcoughlin@apple.com> | 2016-05-06 18:13:30 +0000 |
commit | 4f23e0f8d875abd4e57d00379f068272ac6e4422 (patch) | |
tree | fbdc44b5df8946f6a57d11429644e63f5f7b8d39 /www/analyzer | |
parent | d7c749298232832d75671d4d4ee0c50aa193d830 (diff) |
[www][analyzer] Update recommended suppression mechanism for localization.
Based on feedback from Jordan Rose, make the recommended suppression function be 'static
inline'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268768 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'www/analyzer')
-rw-r--r-- | www/analyzer/faq.html | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/www/analyzer/faq.html b/www/analyzer/faq.html index c5e33a30c4..cf3dc70035 100644 --- a/www/analyzer/faq.html +++ b/www/analyzer/faq.html @@ -84,10 +84,10 @@ You can add <tt>__attribute__((unused))</tt> to the instance variable declaratio <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> |