[Bug middle-end/95485] missing warning writing into function text
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jun 3 16:23:46 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95485
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Ah, yes, -Wpedantic does detect the invalid conversion. But few projects use
-Wpedantic (GCC itself doesn't) and enabling the warning in -Wall or -Wextra
would likely lead to lots of noise for code that converts between object and
function pointers (POSIX requires it to work).
A warning implemented in a front end can also only detect questionable
conversions but not the actual writes, which is what the warning I'm working on
does (i.e., detect stores into read-only storage).
More information about the Gcc-bugs
mailing list