This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -Wswitch and default case


On Fri, 23 Nov 2001, Tom Tromey wrote:
>I've run into a case where I'd like to use -Wswitch but also have a
>default case in my switch.
>
[...]
>Has anybody tried to implement this change?
>If not I'll submit a feature request.

I like this feature. Itīs hard to write robust code
in C using enumīs and switches and gcc diagnostic could
be much better here.

One could introduce a command line option like -Wswitch-all
or/and enable this option in the source for every default that
should be hidden by adding an attribute to default or use a
special version like __default / __silent_default /  ...

Hartmut


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]