Closed badbadc0ffee closed 3 years ago
Sorry it took me so long to get to this, but thanks for the report!
It looks like this has been fixed since at least IAR 8.5.9; it now returns false. I'm just going to ignore __has_attribute for < 8.5.9, but I'll add explicit tests for the attributes IAR is known to support so this should actually improve the number of situations where we can output the attributes in question.
Unfortunately __has_extension(attribute_deprecated_with_message)
is broken (as of 8.5.9); it seems like their feature detection macros are pretty unreliable ☹. I've added an exception for attribute_deprecated_with_message, but for now we still basically trust __has_extension..
This will be included in the next version, which I'll be releasing soon.
The IAR compiler appears to by lying about attribute support:
__has_attribute(nonnull)
,__has_attribute(const)
and__has_attribute(pure)
are falsely reporting existing compiler support for these attributes (which leads to warnings when the resulting code is compiled).Warning[Pa167]: the "__nonnull__" attribute is not supported
I'd suggest to suppress the attribute usage when using the IAR compiler for these attributes like so: