This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: CHILL warning question ... (grant.c & typeck.c spots)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: CHILL warning question ... (grant.c & typeck.c spots)
- From: Dave Brolley <brolley at cygnus dot com>
- Date: Wed, 30 Sep 1998 15:19:50 -0400
- CC: egcs at cygnus dot com
- Organization: Cygnus Solutions Canada Ltd
- References: <199809300159.VAA17656@caip.rutgers.edu>
Kaveh R. Ghazi wrote:
> ---------------------------
> grant.c: In function `decode_decl_selective':
> grant.c:2508: warning: enumeration value `__DUMMY' not handled in switch
> [...]
> grant.c:2508: warning: case value `29' not in enumerated type `chill_tree_code'
> grant.c:2508: warning: case value `31' not in enumerated type `chill_tree_code'
> grant.c:2508: warning: case value `32' not in enumerated type `chill_tree_code'
> grant.c:2508: warning: case value `33' not in enumerated type `chill_tree_code'
> grant.c:2508: warning: case value `36' not in enumerated type `chill_tree_code'
> ---------------------------
This one uses enumerators from both enum tree_code and enum chill_tree_code. I think one
way to get rid of the warnings might be to change the switch statement itself to
switch ((int)TREE_CODE (decl))
since enumerators have type int in C anyway. A default: label will get rid of the other
warning, but I'm not sure myself whether it should abort, or fall though.
> grant.c: In function `really_grant_this':
> grant.c:2792: warning: enumeration value `__DUMMY' not handled in switch
> [...]
> grant.c:2792: warning: case value `29' not in enumerated type `chill_tree_code'
> grant.c:2792: warning: case value `31' not in enumerated type `chill_tree_code'
> grant.c:2792: warning: case value `32' not in enumerated type `chill_tree_code'
> grant.c:2792: warning: case value `33' not in enumerated type `chill_tree_code'
> ---------------------------
Same with this one, except it seems clear that the default: should fall through in order
to generrate the error message.
> typeck.c: In function `chill_resulting_class':
> typeck.c:2039: warning: enumeration value `CH_NULL_CLASS' not handled in switch
> typeck.c:2039: warning: enumeration value `CH_REFERENCE_CLASS' not handled in switch
> ---------------------------
> typeck.c:2055: warning: enumeration value `CH_NULL_CLASS' not handled in switch
> typeck.c:2055: warning: enumeration value `CH_REFERENCE_CLASS' not handled in switch
> ---------------------------
> typeck.c:2071: warning: enumeration value `CH_NULL_CLASS' not handled in switch
> typeck.c:2071: warning: enumeration value `CH_REFERENCE_CLASS' not handled in switch
> ---------------------------
> typeck.c:2072: warning: enumeration value `CH_NULL_CLASS' not handled in switch
> typeck.c:2072: warning: enumeration value `CH_REFERENCE_CLASS' not handled in switch
> ---------------------------
These should all have default: labels which fall through in order to generate the error
message at the bottom of the function. The outer switch should also have breaks added
for each block.
Dave