http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57555
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- The standard says that ~foo has type int and value -256, so assigning it to uint8_t changes the value, so the warning is correct. The warning is only given when foo is constant because otherwise the value of ~foo is not a compile-time constant.