c-decl.c (diagnose_mismatched_decls): Improve error message.
2004-06-13 Eric Christopher <echristo@redhat.com> * c-decl.c (diagnose_mismatched_decls): Improve error message. Remove unused code. * c-typeck.c (comptypes): Add location in standard we're checking. 2004-06-13 Eric Christopher <echristo@redhat.com> * gcc.dg/noncompile/redecl-1.c: Fix error message. From-SVN: r83060
This commit is contained in:
parent
fc6b41718d
commit
118a3a8ba8
|
@ -1,3 +1,9 @@
|
|||
2004-06-13 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* c-decl.c (diagnose_mismatched_decls): Improve error message.
|
||||
Remove unused code.
|
||||
* c-typeck.c (comptypes): Add location in standard we're checking.
|
||||
|
||||
2004-06-13 Kaz Kojima <kkojima@gcc.gnu.org>
|
||||
|
||||
* config/sh/libgcc-std.ver: Add __unorddf2 and __unordsf2 with
|
||||
|
|
27
gcc/c-decl.c
27
gcc/c-decl.c
|
@ -1138,7 +1138,10 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
|
|||
}
|
||||
else
|
||||
{
|
||||
error ("%Jconflicting types for '%D'", newdecl, newdecl);
|
||||
if (TYPE_QUALS (newtype) != TYPE_QUALS (oldtype))
|
||||
error ("%J conflicting type qualifiers for '%D'", newdecl, newdecl);
|
||||
else
|
||||
error ("%Jconflicting types for '%D'", newdecl, newdecl);
|
||||
diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype);
|
||||
locate_old_decl (olddecl, error);
|
||||
return false;
|
||||
|
@ -1365,28 +1368,6 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
|
|||
locate_old_decl (olddecl, error);
|
||||
return false;
|
||||
}
|
||||
|
||||
/* These bits are only type qualifiers when applied to objects. */
|
||||
if (TREE_THIS_VOLATILE (newdecl) != TREE_THIS_VOLATILE (olddecl))
|
||||
{
|
||||
if (TREE_THIS_VOLATILE (newdecl))
|
||||
pedwarn ("%Jvolatile declaration of '%D' follows "
|
||||
"non-volatile declaration", newdecl, newdecl);
|
||||
else
|
||||
pedwarn ("%Jnon-volatile declaration of '%D' follows "
|
||||
"volatile declaration", newdecl, newdecl);
|
||||
pedwarned = true;
|
||||
}
|
||||
if (TREE_READONLY (newdecl) != TREE_READONLY (olddecl))
|
||||
{
|
||||
if (TREE_READONLY (newdecl))
|
||||
pedwarn ("%Jconst declaration of '%D' follows "
|
||||
"non-const declaration", newdecl, newdecl);
|
||||
else
|
||||
pedwarn ("%Jnon-const declaration of '%D' follows "
|
||||
"const declaration", newdecl, newdecl);
|
||||
pedwarned = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* Optional warning for completely redundant decls. */
|
||||
|
|
|
@ -598,7 +598,7 @@ comptypes (tree type1, tree type2, int flags)
|
|||
if (TREE_CODE (t1) != TREE_CODE (t2))
|
||||
return 0;
|
||||
|
||||
/* Qualifiers must match. */
|
||||
/* Qualifiers must match. C99 6.7.3p9 */
|
||||
|
||||
if (TYPE_QUALS (t1) != TYPE_QUALS (t2))
|
||||
return 0;
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
2004-06-13 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* gcc.dg/noncompile/redecl-1.c: Fix error message.
|
||||
|
||||
2004-06-12 Paul Brook <paul@codesourcery.com>
|
||||
|
||||
* gfortran.fortran-torture/execute/contained_3.f90: New test.
|
||||
|
@ -17021,4 +17025,3 @@ rlsruhe.de>
|
|||
correspond to c-torture 1.11.
|
||||
|
||||
* New file.
|
||||
|
||||
|
|
|
@ -5,6 +5,5 @@ int
|
|||
foo ()
|
||||
{
|
||||
int bar; /* { dg-error "previous.*decl" "previous.*decl" } */
|
||||
volatile int bar; /* { dg-error "conflicting types" "conflicting types" } */
|
||||
volatile int bar; /* { dg-error "conflicting type qualifiers" "conflicting type qualifiers" } */
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue