On Tue, 16 Apr 2019 at 04:06, Justin Bassett wrote: > > The following code will emit a warning with -Wattributes: > > [[some_ns::some_attribute]] > void call_me(); > > <source>:2:14: warning: 'some_ns::some_attribute' scoped attribute > directive ignored [-Wattributes] > 2 | void call_me(); > | ^ > > I want to disable the warning for third party attributes, but this warning > is very useful for detecting typos of standard attributes, so I want to > keep it for all other attributes. AFAIK, there's no way to turn off the > warning just for one attribute, just all of them (-Wno-attributes). > > To solve this, I propose that we add the ability to specify attributes to > ignore if they are unknown. In other words, something like this: > '-Wignore-unknown-attribute=some_ns::some_attribute'. > > There are some alternatives, such as only warning if the edit distance is > close to a known attribute, but I think that specifying the known attribute > in the build system like this is better, as it will also catch > misspellings of [[some_ns::some_attribute]].
An option like that has been discussed before. I thought it was in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86368 but I don't see it there, so feel free to add a comment about it there. I still like my suggestion at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86368#c2