[Bug c/91107] __attribute__((pure)) to function with non-const pointers
colomar.6.4.3 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jul 8 11:46:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91107
--- Comment #2 from Alejandro Colomar <colomar.6.4.3 at gmail dot com> ---
Technically it can modify globals as long as that doesn't affect the state of
the program, but in this case it is affecting the state of the program, so it
isn't a pure function.
Fair enough, then the bug claim is that GCC shouldn't allow functions accepting
non-const pointers.
--- Comment #3 from Alejandro Colomar <colomar.6.4.3 at gmail dot com> ---
Technically it can modify globals as long as that doesn't affect the state of
the program, but in this case it is affecting the state of the program, so it
isn't a pure function.
Fair enough, then the bug claim is that GCC shouldn't allow functions accepting
non-const pointers.
More information about the Gcc-bugs
mailing list