diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 71289d2475c..201ecdc0797 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-08-11 Kaveh R. Ghazi + + * c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for + unprototyped function pointer casts on integer constants. + 2000-08-11 Laurynas Biveinis * fixproto: Recognize DOS paths with drive letters as absolute paths. diff --git a/gcc/c-parse.in b/gcc/c-parse.in index 4e6d434523c..3e131cc752e 100644 --- a/gcc/c-parse.in +++ b/gcc/c-parse.in @@ -518,7 +518,14 @@ alignof: cast_expr: unary_expr | '(' typename ')' cast_expr %prec UNARY - { tree type = groktypename ($2); + { tree type; + int SAVED_warn_strict_prototypes = warn_strict_prototypes; + /* This avoids warnings about unprototyped casts on + integers. E.g. "#define SIG_DFL (void(*)())0". */ + if (TREE_CODE ($4) == INTEGER_CST) + warn_strict_prototypes = 0; + type = groktypename ($2); + warn_strict_prototypes = SAVED_warn_strict_prototypes; $$ = build_c_cast (type, $4); } | '(' typename ')' '{' { start_init (NULL_TREE, NULL, 0);