diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-08-20 04:04:47 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-08-20 04:04:47 +0000 |
commit | ccc014442a6731846c6e852a8ebbdc889d5c113b (patch) | |
tree | 425049d868b986693043ccff94f8c96bf12c8778 | |
parent | a6f3e2539ea54d97d7459af06de55b6e467a9e2c (diff) | |
download | gcc-ccc014442a6731846c6e852a8ebbdc889d5c113b.zip gcc-ccc014442a6731846c6e852a8ebbdc889d5c113b.tar.gz gcc-ccc014442a6731846c6e852a8ebbdc889d5c113b.tar.bz2 |
cpppch.c (cpp_valid_state): Re-add warning about PCH not used because some macro is defined.
2003-08-19 Geoffrey Keating <geoffk@apple.com>
* cpppch.c (cpp_valid_state): Re-add warning about PCH not used
because some macro is defined.
Index: testsuite/ChangeLog
2003-08-19 Geoffrey Keating <geoffk@apple.com>
* gcc.dg/pch/warn-1.c: New.
* gcc.dg/pch/warn-1.hs: New.
* lib/dg-pch.exp (dg-pch): Use 'return' not 'continue' to skip
not-tested file.
From-SVN: r70592
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cpppch.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/warn-1.c | 10 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pch/warn-1.hs | 5 | ||||
-rw-r--r-- | gcc/testsuite/lib/dg-pch.exp | 2 |
6 files changed, 34 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7fbdfdb..ee82ca1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ 2003-08-19 Geoffrey Keating <geoffk@apple.com> + * cpppch.c (cpp_valid_state): Re-add warning about PCH not used + because some macro is defined. + * config/darwin.h (LINK_COMMAND_SPEC): Add -arch and -arch_only options. * config/i386/darwin.h (ASM_SPEC): New. diff --git a/gcc/cpppch.c b/gcc/cpppch.c index bdb7d16..e1dc1d7 100644 --- a/gcc/cpppch.c +++ b/gcc/cpppch.c @@ -509,7 +509,13 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd) else if (cmp > 0) ++i; else - goto fail; + { + if (CPP_OPTION (r, warn_invalid_pch)) + cpp_error (r, DL_WARNING_SYSHDR, + "%s: not used because `%s' is defined", + name, first); + goto fail; + } } free(nl.defs); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d6e045e..5554668 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2003-08-19 Geoffrey Keating <geoffk@apple.com> + + * gcc.dg/pch/warn-1.c: New. + * gcc.dg/pch/warn-1.hs: New. + + * lib/dg-pch.exp (dg-pch): Use 'return' not 'continue' to skip + not-tested file. + 2003-08-19 Andrew Pinski <pinskia@physics.uc.edu> * gcc.dg/uninit-E.c: Add forgotten dg-warning marker. diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc/testsuite/gcc.dg/pch/warn-1.c new file mode 100644 index 0000000..779577d --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/warn-1.c @@ -0,0 +1,10 @@ +/* { dg-options "-I. -Winvalid-pch" } */ + +#define DEFINED_VALUE 3 + +#include "warn-1.h"/* { dg-error "not used because `DEFINED_VALUE' is defined|No such file" } */ + +int main(void) +{ + return DEFINED_VALUE; +} diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.hs b/gcc/testsuite/gcc.dg/pch/warn-1.hs new file mode 100644 index 0000000..460963f --- /dev/null +++ b/gcc/testsuite/gcc.dg/pch/warn-1.hs @@ -0,0 +1,5 @@ +enum { + DEFINED_VALUE +}; + + diff --git a/gcc/testsuite/lib/dg-pch.exp b/gcc/testsuite/lib/dg-pch.exp index 9bf3993..5ab34ec 100644 --- a/gcc/testsuite/lib/dg-pch.exp +++ b/gcc/testsuite/lib/dg-pch.exp @@ -21,7 +21,7 @@ proc dg-pch { subdir test options suffix } { # If we're only testing specific files and this isn't one of them, skip it. if ![runtest_file_p $runtests $test] { - continue + return } set nshort "$subdir/[file tail $test]" set bname "[file rootname [file tail $nshort]]" |