[Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const

david.bolvansky at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Aug 16 16:19:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=18487

Dávid Bolvanský <david.bolvansky at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david.bolvansky at gmail dot com

--- Comment #18 from Dávid Bolvanský <david.bolvansky at gmail dot com> ---
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.


More information about the Gcc-bugs mailing list