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: gcc error messages


> In gcc when you "switch" on a "enum"
> and there is no "default:". gcc issues a 
> warning message for each declared "enum" value
> that does not have a "case"  In general
> this is a good idea. It stops errors.
> 
> But in the case of "enum"s with a large number
> of members. A simple syntax error can ending
> generating a vast number of useless warning
> messages. In my case an extra '}' ended up
> generating over 500 lines of warning messages.
> 
> This much output does not help the programmer.
> It would be better is if gcc took a ratio
> of the missing "enum" values to the total set
> of values and issued just one message if the
> ratio was large.  I suggest the number
> should be: one message if there are more than 5
> missing "enum" values or more then 10% missing 
> "enum" values, otherwise print a message for
> each "enum" value.

Alternatively, always generate one message, which would list the first few
missing enums (perhaps up to 5 as you suggest), together with a count of
how many aren't handled if there are more than that.


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