[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))
zsojka at seznam dot cz
gcc-bugzilla@gcc.gnu.org
Wed Jul 17 13:56:02 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66425
--- Comment #73 from Zdenek Sojka <zsojka at seznam dot cz> ---
See MISRA C:2012 Rule 17.7:
"... If the return value of a function is intended not to be used explicitly,
it should be cast to the void type. ..."
It would be helpful if gcc could be used to write MISRA-compliant code, or at
least if it wouldn't generate compilation warnings when the programmer is
targeting MISRA-compliancy.
I understand this might be a very complex topic, due to gcc being free
software, and other companies possibly providing / selling the tool
qualification.
More information about the Gcc-bugs
mailing list