[PATCH] D24886: Add [[clang::suppress(rule, ...)]] attribute

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 30 09:30:26 PDT 2017


On Sun, Oct 29, 2017 at 4:42 AM, Hristo Hristov via Phabricator
<reviews at reviews.llvm.org> wrote:
> roccoor added a comment.
>
> Microsoft supports:
>
>   [[gsl::suppress(bounds.3)]]
>
> Clang requires:
>
>   [[gsl::suppress("bounds.3")]]
>
> Why is this inconsistency?

I believe that when we added this attribute, MSVC did not support the
attribute at all and so we did what was recommended by the C++ Core
Guideline maintainers.

It would be possible for us to support the Microsoft syntax, but it
may require special parsing support.

~Aaron

>
> Here is an example from  CppCoreGuidelines
>
>   [[suppress(bounds)]] char* raw_find(char* p, int n, char x)    // find x in p[0]..p[n - 1]
>   {
>       // ...
>   }
>
>
> Repository:
>   rL LLVM
>
> https://reviews.llvm.org/D24886
>
>
>


More information about the cfe-commits mailing list