re PR c/28800 (warning "ISO C forbids an empty source file" could be improved)

gcc/:
PR c/28800
* c-parser.c (c_parser_translation_unit): Warn for empty
translation unit, not empty source file.

gcc/testsuite/:
PR c/28800
* gcc.dg/empty-source-2.c: Adjust for warning message.
* gcc.dg/empty-source-3.c: Likewise.
* gcc.dg/pack-test-2.c: Adjust comment.
* gcc.dg/pragma-ep-2.c: Likewise.
* gcc.dg/pragma-re-2.c: Likewise.
* gcc.dg/va-arg-2.c: Likewise.

From-SVN: r132690
This commit is contained in:
Ralf Wildenhues 2008-02-26 22:41:16 +00:00 committed by Ralf Wildenhues
parent e19bb1866c
commit 369239efc9
9 changed files with 23 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2008-02-26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/28800
* c-parser.c (c_parser_translation_unit): Warn for empty
translation unit, not empty source file.
2008-02-26 Paul Brook <paul@codesourcery.com>
* config/arm/arm.c (thumb_set_frame_pointer): Ensure SP is first

View File

@ -1069,7 +1069,7 @@ c_parser_translation_unit (c_parser *parser)
if (c_parser_next_token_is (parser, CPP_EOF))
{
if (pedantic)
pedwarn ("%HISO C forbids an empty source file",
pedwarn ("%HISO C forbids an empty translation unit",
&c_parser_peek_token (parser)->location);
}
else

View File

@ -1,3 +1,13 @@
2008-02-26 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
PR c/28800
* gcc.dg/empty-source-2.c: Adjust for warning message.
* gcc.dg/empty-source-3.c: Likewise.
* gcc.dg/pack-test-2.c: Adjust comment.
* gcc.dg/pragma-ep-2.c: Likewise.
* gcc.dg/pragma-re-2.c: Likewise.
* gcc.dg/va-arg-2.c: Likewise.
2008-02-26 Tobias Burnus <burnus@net-b.de>
PR fortran/35033

View File

@ -3,4 +3,4 @@
/* { dg-do compile } */
/* { dg-options "-pedantic" } */
/* { dg-warning "ISO C forbids an empty source file" "empty" { target *-*-* } 6 } */
/* { dg-warning "ISO C forbids an empty translation unit" "empty" { target *-*-* } 6 } */

View File

@ -4,4 +4,4 @@
/* { dg-do compile } */
/* { dg-options "-pedantic-errors" } */
/* { dg-error "ISO C forbids an empty source file" "empty" { target *-*-* } 7 } */
/* { dg-error "ISO C forbids an empty translation unit" "empty" { target *-*-* } 7 } */

View File

@ -22,4 +22,4 @@
#pragma pack(push, foo, 3) /* { dg-warning "small power of two" } */
extern int blah; /* prevent "ISO C forbids an empty source file" */
extern int blah; /* prevent "ISO C forbids an empty translation unit" */

View File

@ -4,4 +4,4 @@
#pragma extern_prefix foo /* { dg-warning "malformed" } */
#pragma extern_prefix "foo" 1 /* { dg-warning "junk" } */
int bar; /* silence `ISO C forbids an empty source file' warning */
int bar; /* silence `ISO C forbids an empty translation unit' warning */

View File

@ -5,4 +5,4 @@
#pragma redefine_extname foo 1 /* { dg-warning "malformed" } */
#pragma redefine_extname foo bar 2 /* { dg-warning "junk" } */
int bar; /* silence `ISO C forbids an empty source file' warning */
int bar; /* silence `ISO C forbids an empty translation unit' warning */

View File

@ -9,4 +9,4 @@
/* { dg-error "no longer implements" "#error 1" { target *-*-* } 4 } */
/* { dg-error "Revise your code" "#error 2" { target *-*-* } 5 } */
int x; /* prevent empty-source-file warning */
int x; /* prevent empty-translation-unit warning */