[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const
egallager at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sun Aug 18 04:35:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487
--- Comment #19 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Dávid Bolvanský from comment #18)
> a.c
>
> int foo(void) __attribute__((const));
>
>
> int main(void) {
> return foo();
> }
>
> b.c
>
> #include <stdio.h>
>
> int foo(void) {
> puts("BUM");
> return 0;
> }
>
> gcc a.c b.c -Wall -Wextra -flto -o bum
>
>
> It would be nice to get a warning.
The LTO case would probably be tougher to get right than the simple case...
More information about the Gcc-bugs
mailing list