Commit 04de7314 by Zack Weinberg Committed by Zack Weinberg

* c-decl.c (pushdecl): Invert sense of test for non-global types.

From-SVN: r34107
parent a3afe920
2000-05-23 Zack Weinberg <zack@wolery.cumb.org>
* c-decl.c (pushdecl): Invert sense of test for non-global types.
Tue May 23 18:11:42 2000 J"orn Rennecke <amylaar@cygnus.co.uk>
* reload1.c (reload_cse_move2add): Honor TRULY_NOOP_TRUNCATION.
......@@ -2202,7 +2202,7 @@ pushdecl (x)
{
if (type == error_mark_node)
break;
if (! TYPE_CONTEXT (type))
if (TYPE_CONTEXT (type))
{
warning_with_decl (x, "type of external `%s' is not global");
/* By exiting the loop early, we leave TYPE nonzero,
......
/* Test for the warning about external functions with non-global
types. In -traditional mode, these functions are globally visible
even if declared in an inner scope, so their return types should
also be visible. */
/* { dg-do compile } */
/* { dg-options -traditional } */
int
main ()
{
struct foo { int a, b; };
extern struct foo *bar(); /* { dg-warning "type of external" "good warn" } */
extern int baz(); /* { dg-bogus "type of external" "bad warn" } */
return 0;
}
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