aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2000-08-11 16:25:02 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2000-08-11 16:25:02 +0000
commit402d11e13fdea582e4a4fc6aee14668b7684a5d3 (patch)
treec2abe25134dbe88ed966cd68232e19eca89a2dab /gcc
parenta8e2bb766665027e5e04de7e8ec3085a1b117e8a (diff)
downloadgcc-402d11e13fdea582e4a4fc6aee14668b7684a5d3.zip
gcc-402d11e13fdea582e4a4fc6aee14668b7684a5d3.tar.gz
gcc-402d11e13fdea582e4a4fc6aee14668b7684a5d3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-parse.in9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 71289d2..201ecdc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-11 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * c-parse.in (cast_expr): Avoid -Wstrict-prototype warnings for
+ unprototyped function pointer casts on integer constants.
+
2000-08-11 Laurynas Biveinis <lauras@softhome.net>
* fixproto: Recognize DOS paths with drive letters as absolute paths.
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 4e6d434..3e131cc 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);