diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2001-03-13 23:55:10 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2001-03-13 23:55:10 +0000 |
commit | 41947a54d2d19e8432255617cb7b9f28de65c413 (patch) | |
tree | 3fc1eb6452163596e3e8d8e1f8d49711b555bc6d /gcc/cpplib.c | |
parent | fafcb5c9370abb44c61fbbd68c8b4b09685e86fa (diff) | |
download | gcc-41947a54d2d19e8432255617cb7b9f28de65c413.zip gcc-41947a54d2d19e8432255617cb7b9f28de65c413.tar.gz gcc-41947a54d2d19e8432255617cb7b9f28de65c413.tar.bz2 |
cppfiles.c (NO_INCLUDE_PATH): New macro.
* cppfiles.c (NO_INCLUDE_PATH): New macro.
(find_include_file): Decide here which part of the include
chain to start the search. Complain about an empty include
chain in all cases apart from an abolsute file name.
(_cpp_execute_include): Don't choose the search chain here.
Don't call handle_missing_include in the case of an empty
include chain.
(_cpp_compare_file_date): Don't choose the search chain here.
* cpplib.c (do_include_next): Move the in-main-file diagnostic
here from _cpp_execute_include. Behave like #include if
we're in the main file.
From-SVN: r40445
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 571e204..963ab9b 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -619,7 +619,14 @@ do_include_next (pfile) cpp_token header; if (!parse_include (pfile, &header)) - _cpp_execute_include (pfile, &header, 0, 1); + { + /* If this is the primary source file, warn and use the normal + search logic. */ + if (! pfile->buffer->prev) + cpp_warning (pfile, "#include_next in primary source file"); + + _cpp_execute_include (pfile, &header, 0, pfile->buffer->prev != 0); + } } /* Subroutine of do_line. Read possible flags after file name. LAST |