[clang] [Clang] raise extension warning for unknown namespaced attributes (PR #120925)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 3 08:21:56 PST 2025


================
@@ -179,6 +179,8 @@ def err_opencl_unknown_type_specifier : Error<
 
 def warn_unknown_attribute_ignored : Warning<
   "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
+def ext_unknown_attribute_ignored : Extension<
+  "unknown attribute %0 ignored">, InGroup<UnknownAttributes>;
----------------
a-tarasyuk wrote:

No, I didn't. Should we address the following concern (maybe only for `c23`) by using a new group with `extension` handling?

> With --std=c23, when using attributes with an arbitrary attribute-prefix, Clang raises the warning -Wunknown-attributes
The whole point of attribute-prefixs is to be able to use attributes for multiple compilers without a #ifdef-hell. Thus, there is no reason for this warning to be raised. And if a warning has to be raised, it should be a different one (perhaps -Wunknown-attribute-prefix) such that it can selectively be disabled (since -Wunknown-attributes is useful in case of misspelled attributes in general).

https://github.com/llvm/llvm-project/pull/120925


More information about the cfe-commits mailing list