Commit 7fdc3e09 by Joseph Myers Committed by Joseph Myers

c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in system headers.

	* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in
	system headers.

testsuite:
	* gcc.dg/complex-2.c, gcc.dg/complex-2.h: New test.

From-SVN: r88571
parent 1b36c818
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk> 2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (declspecs_add_type): Don't pedwarn for _Complex in
system headers.
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* c-decl.c (pushdecl): When an extern declaration at block scope * c-decl.c (pushdecl): When an extern declaration at block scope
refers to a visible entity with internal linkage, use the old DECL refers to a visible entity with internal linkage, use the old DECL
rather than the new one. rather than the new one.
......
...@@ -6816,7 +6816,7 @@ declspecs_add_type (struct c_declspecs *specs, tree type) ...@@ -6816,7 +6816,7 @@ declspecs_add_type (struct c_declspecs *specs, tree type)
break; break;
case RID_COMPLEX: case RID_COMPLEX:
dupe = specs->complex_p; dupe = specs->complex_p;
if (pedantic && !flag_isoc99) if (pedantic && !flag_isoc99 && !in_system_header)
pedwarn ("ISO C90 does not support complex types"); pedwarn ("ISO C90 does not support complex types");
if (specs->typespec_word == cts_void) if (specs->typespec_word == cts_void)
error ("both %<complex%> and %<void%> in " error ("both %<complex%> and %<void%> in "
......
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk> 2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.dg/complex-2.c, gcc.dg/complex-2.h: New test.
2004-10-05 Joseph S. Myers <jsm@polyomino.org.uk>
* gcc.c-torture/compile/20041005-1.c: New test. * gcc.c-torture/compile/20041005-1.c: New test.
2004-10-05 Nathan Sidwell <nathan@codesourcery.com> 2004-10-05 Nathan Sidwell <nathan@codesourcery.com>
......
/* Allow complex types in system headers even with -std=iso9899:1990
-pedantic-errors. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
#include "complex-2.h"
/* Allow complex types in system headers even with -std=iso9899:1990
-pedantic-errors. Header file. */
#pragma GCC system_header
_Complex double x;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment