diff options
author | Richard Stallman <rms@gnu.org> | 1993-09-05 22:35:15 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-09-05 22:35:15 +0000 |
commit | eaf2e788fd09594b1a7aca8685892cc7941ed2c2 (patch) | |
tree | 5d02352ba1633775958b6a1af4aae317a729eae5 /gcc/c-decl.c | |
parent | 7223feb046f9131ea5c65c0bca1b57c118a7bef5 (diff) | |
download | gcc-eaf2e788fd09594b1a7aca8685892cc7941ed2c2.zip gcc-eaf2e788fd09594b1a7aca8685892cc7941ed2c2.tar.gz gcc-eaf2e788fd09594b1a7aca8685892cc7941ed2c2.tar.bz2 |
(grokdeclarator): For PARM_DECLs, only call
c_build_type_variant is constp or volatilep is true.
From-SVN: r5263
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 4d9424f..df0a515 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -4481,8 +4481,10 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) if (TREE_CODE (type) == ARRAY_TYPE) { /* Transfer const-ness of array into that of type pointed to. */ - type = build_pointer_type - (c_build_type_variant (TREE_TYPE (type), constp, volatilep)); + type = TREE_TYPE (type); + if (constp || volatilep) + type = c_build_type_variant (type, constp, volatilep); + type = build_pointer_type (type); volatilep = constp = 0; size_varies = 0; } @@ -4490,7 +4492,9 @@ grokdeclarator (declarator, declspecs, decl_context, initialized) { if (pedantic && (constp || volatilep)) pedwarn ("ANSI C forbids const or volatile function types"); - type = build_pointer_type (c_build_type_variant (type, constp, volatilep)); + if (constp || volatilep) + type = c_build_type_variant (type, constp, volatilep); + type = build_pointer_type (type); volatilep = constp = 0; } |