GNU bug report logs -
#75964
Switching the Emacs build to -Wswitch-enum in src/
Previous Next
Full log
View this message in rfc822 format
>>>>> On Fri, 31 Jan 2025 12:48:02 +0000, Pip Cet via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> said:
>>
>> That might be fine when the enumeration is ours, but if it comes from
>> a system header file, the only practical option is 0, with 1 being a
>> very distant second (having a switch with many dozens of values is
>> hardly a good thing).
Pip> You're talking about a different problem then. If an
Pip> externally-controlled enum is expected to grow, we want a compiler
Pip> warning to let us know when this happens, but we also need a default:
Pip> handler that deals with this case. So the right option is that we don't
Pip> need any of the extra options, the default behaviour will be just fine.
Both gcc and clang support case ranges these days, so handling large
enums should not be a problem.
Robert
--
This bug report was last modified 127 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.