From dc5027f47440baef6b984b029fb5c3e5ee59e5ba Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sun, 23 May 2010 21:47:16 +0100 Subject: c-decl.c (diagnose_mismatched_decls): Give error for duplicate typedefs with different but compatible types. * c-decl.c (diagnose_mismatched_decls): Give error for duplicate typedefs with different but compatible types. Allow duplicate typedefs with the same type except for pedantic non-C1X, but give warning for variably modified types. * c-typeck.c (tagged_types_tu_compatible_p, function_types_compatible_p, type_lists_compatible_p, comptypes_internal): Add parameter different_types_p; set *different_types_p for different but compatible types. All callers changed. (comptypes_check_different_types): New. * c-tree.h (comptypes_check_different_types): Declare. testsuite: * gcc.dg/c1x-typedef-1.c, gcc.dg/c1x-typedef-2.c, gcc.dg/c90-typedef-1.c, gcc.dg/c99-typedef-1.c: New tests. * gcc.dg/decl-8.c: Use -std=gnu89 -pedantic-errors. From-SVN: r159767 --- gcc/c-tree.h | 1 + 1 file changed, 1 insertion(+) (limited to 'gcc/c-tree.h') diff --git a/gcc/c-tree.h b/gcc/c-tree.h index 3090a67..1806e2c 100644 --- a/gcc/c-tree.h +++ b/gcc/c-tree.h @@ -506,6 +506,7 @@ extern tree c_objc_common_truthvalue_conversion (location_t, tree); extern tree require_complete_type (tree); extern int same_translation_unit_p (const_tree, const_tree); extern int comptypes (tree, tree); +extern int comptypes_check_different_types (tree, tree, bool *); extern bool c_vla_type_p (const_tree); extern bool c_mark_addressable (tree); extern void c_incomplete_type_error (const_tree, const_tree); -- cgit v1.1