gcc/libcpp
David Malcolm ac81cf0b2b libcpp: Tweak to missing #include source location
This patch tweaks the error message location for missing header files.

Previously these read:

test.c:1:17: fatal error: 404.h: No such file or directory
 #include "404.h"
                 ^
compilation terminated.

With this patch, the pertinent string is underlined:

test.c:1:10: fatal error: 404.h: No such file or directory
 #include "404.h"
          ^~~~~~~
compilation terminated.

gcc/testsuite/ChangeLog:
	* c-c++-common/missing-header-1.c: New test case.
	* c-c++-common/missing-header-2.c: New test case.
	* c-c++-common/missing-header-3.c: New test case.
	* c-c++-common/missing-header-4.c: New test case.

libcpp/ChangeLog:
	* directives.c (do_include_common): Pass on "location" to
	_cpp_stack_include.
	* errors.c (cpp_diagnostic): Reimplement in terms of...
	(cpp_diagnostic_at): New function.
	(cpp_error_at): New function.
	(cpp_errno_filename): Add "loc" param and use it by using
	cpp_error_at rather than cpp_error.
	* files.c (find_file_in_dir): Add "loc" param and pass it to
	open_file_failed.
	(_cpp_find_file): Add "loc" param.  Use it to convert calls to
	cpp_error to cpp_error_at, and pass it to find_file_in_dir and
	open_file_failed.
	(read_file_guts): Add "loc" param.  Use it to convert calls to
	cpp_error to cpp_error_at.  Pass it to cpp_errno_filename.
	(read_file): Add "loc" param.  Pass it to open_file_failed and
	read_file_guts.
	(should_stack_file): Add "loc" param.  Pass it to read_file.
	(_cpp_stack_file): Add "loc" param.  Pass it to should_stack_file.
	(_cpp_stack_include): Add "loc" param.  Pass it to
	_cpp_find_file and _cpp_stack_file.
	(open_file_failed): Add "loc" param.  Pass it to
	cpp_errno_filename.
	(_cpp_fake_include): Add 0 as a source_location in call to
	_cpp_find_file.
	(_cpp_compare_file_date): Likewise.
	(cpp_push_include): Likewise for call to _cpp_stack_include.
	(cpp_push_default_include): Likewise.
	(_cpp_save_file_entries): Likewise for call to open_file_failed.
	(_cpp_has_header): Likewise for call to _cpp_find_file.
	* include/cpplib.h (cpp_errno_filename): Add source_location
	param.
	(cpp_error_at): New declaration.
	* init.c (cpp_read_main_file): Add 0 as a source_location in calls
	to _cpp_find_file and _cpp_stack_file.
	* internal.h (_cpp_find_file): Add source_location param.
	(_cpp_stack_file): Likewise.
	(_cpp_stack_include): Likewise.

From-SVN: r237715
2016-06-22 15:29:21 +00:00
..
include libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
po * sr.po: Update. 2016-06-03 22:07:36 +01:00
ChangeLog libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
ChangeLog.jit
Makefile.in Update copyright years. 2016-01-04 15:30:50 +01:00
aclocal.m4
charset.c re PR c++/69628 (Conditional jump or move depends on uninitialised value(s) in lex_charconst(cpp_token const*) (c-lex.c:1252)) 2016-02-05 20:39:48 +01:00
config.in Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
configure Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
configure.ac Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
directives-only.c Update copyright years. 2016-01-04 15:30:50 +01:00
directives.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
errors.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
expr.c expr.c (cpp_classify_number): Hex floats are new in C++1z. 2016-03-15 08:08:31 -04:00
files.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
identifiers.c Update copyright years. 2016-01-04 15:30:50 +01:00
init.c libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
internal.h libcpp: Tweak to missing #include source location 2016-06-22 15:29:21 +00:00
lex.c Change ENABLE_VALGRIND_CHECKING to 2016-05-20 08:03:25 +00:00
line-map.c c-common.c (get_source_date_epoch): Use int64_t instead of long long. 2016-06-22 01:46:06 +00:00
location-example.txt
macro.c c-common.c (get_source_date_epoch): Rename to cb_get_source_date_epoch. 2016-06-01 16:42:41 +00:00
makeucnid.c Update copyright years. 2016-01-04 15:30:50 +01:00
mkdeps.c Update copyright years. 2016-01-04 15:30:50 +01:00
pch.c Update copyright years. 2016-01-04 15:30:50 +01:00
symtab.c Update copyright years. 2016-01-04 15:30:50 +01:00
system.h Update copyright years. 2016-01-04 15:30:50 +01:00
traditional.c Update copyright years. 2016-01-04 15:30:50 +01:00
ucnid.h Update copyright years. 2016-01-04 15:30:50 +01:00
ucnid.tab Update copyright years. 2016-01-04 15:30:50 +01:00