[Bug c++/57555] Warning on negation of constexpr uint8_t being assigned to uint8_t

megari at mbnet dot fi gcc-bugzilla@gcc.gnu.org
Fri Jun 7 11:36:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57555

--- Comment #1 from Ari Sundholm <megari at mbnet dot fi> ---
It seems that actually just making the variable const suffices:

uint8_t foo() {
    static const uint8_t foo = 0xff;

    uint8_t ret = ~foo;

    return ret;
}



More information about the Gcc-bugs mailing list