[Bug c/66249] -Wformat-signedness should not warn on enums
peter at eisentraut dot org
gcc-bugzilla@gcc.gnu.org
Fri Nov 6 13:28:29 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66249
--- Comment #3 from Peter Eisentraut <peter at eisentraut dot org> ---
The GCC documentation on implementation-defined behavior states that enums are
unsigned unless negative values are included. It says that -fshort-enums is
the default for some ABIs, but there is no indication that signed enums are the
default on some ABIs or platforms or other circumstances. If that is accurate,
then it would seemingly be okay to use %u for enums in most cases (unless they
are signed by inclusion of a negative value) without worries about platform
differences.
More information about the Gcc-bugs
mailing list