diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/cpp/pr32974.c | 6 | ||||
-rw-r--r-- | libcpp/ChangeLog | 6 | ||||
-rw-r--r-- | libcpp/directives.c | 6 |
4 files changed, 22 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4f1b7335dc0..3e5ff061f34 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-08-18 Tom Tromey <tromey@redhat.com> + + PR preprocessor/32974: + * gcc.dg/cpp/pr32974.c: New file. + 2007-08-17 Tobias Burnus <burnus@net-b.de> * gfortran.dg/interface_abstract_1.f90: New. diff --git a/gcc/testsuite/gcc.dg/cpp/pr32974.c b/gcc/testsuite/gcc.dg/cpp/pr32974.c new file mode 100644 index 00000000000..cec6a9e0b4a --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr32974.c @@ -0,0 +1,6 @@ +/* PR preprocessor/32974 - don't warn for extra tokens in pragma dependency */ +/* { dg-do compile } */ + +#pragma GCC dependency "pr32974.c" extra tokens are ok + +int x; diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 0157cf3cee2..7e8dfd5a642 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,9 @@ +2007-08-18 Tom Tromey <tromey@redhat.com> + + PR preprocessor/32974: + * directives.c (parse_include): Don't check for EOL when + processing #pragma dependency. + 2007-07-30 Ollie Wild <aaw@google.com> * directives-only.c: New file. diff --git a/libcpp/directives.c b/libcpp/directives.c index 38ca949f8c9..7f7216265c9 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -698,7 +698,11 @@ parse_include (cpp_reader *pfile, int *pangle_brackets, return NULL; } - if (buf == NULL || CPP_OPTION (pfile, discard_comments)) + if (pfile->directive == &dtable[T_PRAGMA]) + { + /* This pragma allows extra tokens after the file name. */ + } + else if (buf == NULL || CPP_OPTION (pfile, discard_comments)) check_eol (pfile); else { |