https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67314

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2016-01-16
                 CC|                            |msebor at gcc dot gnu.org
     Ever confirmed|0                           |1
      Known to fail|                            |4.9.3, 5.1.0, 6.0
           Severity|normal                      |enhancement

--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I recall wishing for this warning as well.  The trouble is that while gcc makes
it easy to assign without a warning values to enums that are outside the range
of the enumerated type, it makes it difficult to handle such values in case and
switch statements without eliciting one of the -Wswitch warnings.  In those
cases gcc either complains about "case values being not in enumerated type" or
it complains about a "switch missing default case" and there doesn't seem to be
an easy way to make it happy.  I agree with Manuel that having a warning option
like -Wassign-enum would be useful.  Thus I confirm this as an enhancement
request.

Reply via email to