From 402d11e13fdea582e4a4fc6aee14668b7684a5d3 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Fri, 11 Aug 2000 16:25:02 +0000 Subject: [PATCH] c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for unprototyped function pointer casts on... * c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for unprototyped function pointer casts on integer constants. From-SVN: r35638 --- gcc/ChangeLog | 5 +++++ gcc/c-parse.in | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) 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);