* c-decl.c (pushdecl): Invert sense of test for non-global types.
From-SVN: r34107
This commit is contained in:
parent
a3afe9205d
commit
04de731462
3 changed files with 23 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
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,
|
||||
|
|
18
gcc/testsuite/gcc.dg/ext-glob.c
Normal file
18
gcc/testsuite/gcc.dg/ext-glob.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
/* 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue