This is the mail archive of the
mailing list for the GCC project.
Re: gcc error messages
- From: Joe Buck <Joe dot Buck at synopsys dot com>
- To: pjf at thinkage dot ca (Peter Fraser)
- Cc: gcc at gnu dot org ('gcc at gnu dot org')
- Date: Mon, 26 Aug 2002 12:49:54 -0700 (PDT)
- Subject: 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.