aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-decl.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-06-11 14:26:19 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2001-06-11 14:26:19 +0100
commit1552f8745719c1b62efc50579e200c7e851924c5 (patch)
tree28ef0c84630cc4987e22cb7097cb3d5b25adff66 /gcc/c-decl.c
parentcff75d2efee00dc45d4b9856c7b94c6660bd6e90 (diff)
downloadgcc-1552f8745719c1b62efc50579e200c7e851924c5.zip
gcc-1552f8745719c1b62efc50579e200c7e851924c5.tar.gz
gcc-1552f8745719c1b62efc50579e200c7e851924c5.tar.bz2
re PR c/3116 (Bug with using oldstyle prototype declarations)
* c-decl.c (store_parm_decls): When comparing types in an old-style function declaration with those from a previous prototype, compare the unqualified versions of parameter types. Fixes PR c/3116. testsuite: * gcc.c-torture/compile/20010611-1.c: New test. From-SVN: r43186
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r--gcc/c-decl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index b68f772..5d50394 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -6436,9 +6436,11 @@ store_parm_decls ()
"prototype declaration");
break;
}
- /* Type for passing arg must be consistent
- with that declared for the arg. */
- if (! comptypes (DECL_ARG_TYPE (parm), TREE_VALUE (type)))
+ /* Type for passing arg must be consistent with that
+ declared for the arg. ISO C says we take the unqualified
+ type for parameters declared with qualified type. */
+ if (! comptypes (TYPE_MAIN_VARIANT (DECL_ARG_TYPE (parm)),
+ TYPE_MAIN_VARIANT (TREE_VALUE (type))))
{
if (TYPE_MAIN_VARIANT (TREE_TYPE (parm))
== TYPE_MAIN_VARIANT (TREE_VALUE (type)))