https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66974
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |msebor at gcc dot gnu.org --- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- (In reply to Ganesh Ajjanagadde from comment #2) For what it's worth, telling gcc that the argument is constrained to the limited range of values either by converting it like so: order = ((struct { unsigned order: 2; }){ order }).order; or by declaring the function to take an argument of that type eliminates the warnings and results in far simpler object code.