diff options
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-family/c-opts.c | 9 | ||||
-rw-r--r-- | gcc/c-family/c-pch.c | 17 | ||||
-rw-r--r-- | gcc/c-family/cppspec.c | 5 |
4 files changed, 22 insertions, 14 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 851e664503f..9764b7c144a 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2015-01-30 Joseph Myers <joseph@codesourcery.com> + + * c-opts.c, c-pch.c, cppspec.c: All callers of fatal_error changed + to pass input_location as first argument. + 2015-01-23 Tom de Vries <tom@codesourcery.com> PR libgomp/64672 diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 124c91c700f..d10e5bd8daa 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -928,7 +928,7 @@ c_common_post_options (const char **pfilename) if (out_stream == NULL) { - fatal_error ("opening output file %s: %m", out_fname); + fatal_error (input_location, "opening output file %s: %m", out_fname); return false; } @@ -1111,7 +1111,8 @@ c_common_finish (void) { deps_stream = fopen (deps_file, deps_append ? "a": "w"); if (!deps_stream) - fatal_error ("opening dependency file %s: %m", deps_file); + fatal_error (input_location, "opening dependency file %s: %m", + deps_file); } } @@ -1121,10 +1122,10 @@ c_common_finish (void) if (deps_stream && deps_stream != out_stream && (ferror (deps_stream) || fclose (deps_stream))) - fatal_error ("closing dependency file %s: %m", deps_file); + fatal_error (input_location, "closing dependency file %s: %m", deps_file); if (out_stream && (ferror (out_stream) || fclose (out_stream))) - fatal_error ("when writing output to %s: %m", out_fname); + fatal_error (input_location, "when writing output to %s: %m", out_fname); } /* Either of two environment variables can specify output of diff --git a/gcc/c-family/c-pch.c b/gcc/c-family/c-pch.c index 599b600dc66..0ede92ab7cc 100644 --- a/gcc/c-family/c-pch.c +++ b/gcc/c-family/c-pch.c @@ -122,7 +122,8 @@ pch_init (void) f = fopen (pch_file, "w+b"); if (f == NULL) - fatal_error ("can%'t create precompiled header %s: %m", pch_file); + fatal_error (input_location, "can%'t create precompiled header %s: %m", + pch_file); pch_outfile = f; gcc_assert (memcmp (executable_checksum, no_checksum, 16) != 0); @@ -144,7 +145,7 @@ pch_init (void) || fwrite (executable_checksum, 16, 1, f) != 1 || fwrite (&v, sizeof (v), 1, f) != 1 || fwrite (target_validity, v.target_data_length, 1, f) != 1) - fatal_error ("can%'t write to %s: %m", pch_file); + fatal_error (input_location, "can%'t write to %s: %m", pch_file); /* Let the debugging format deal with the PCHness. */ (*debug_hooks->handle_pch) (0); @@ -202,7 +203,7 @@ c_common_write_pch (void) if (fseek (pch_outfile, 0, SEEK_SET) != 0 || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1) - fatal_error ("can%'t write %s: %m", pch_file); + fatal_error (input_location, "can%'t write %s: %m", pch_file); fclose (pch_outfile); @@ -230,7 +231,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) sizeread = read (fd, ident, IDENT_LENGTH + 16); if (sizeread == -1) - fatal_error ("can%'t read %s: %m", name); + fatal_error (input_location, "can%'t read %s: %m", name); else if (sizeread != IDENT_LENGTH + 16) { if (cpp_get_options (pfile)->warn_invalid_pch) @@ -271,7 +272,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) executable, so it ought to be long enough that we can read a c_pch_validity structure. */ if (read (fd, &v, sizeof (v)) != sizeof (v)) - fatal_error ("can%'t read %s: %m", name); + fatal_error (input_location, "can%'t read %s: %m", name); /* The allowable debug info combinations are that either the PCH file was built with the same as is being used now, or the PCH file was @@ -322,7 +323,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd) if ((size_t) read (fd, this_file_data, v.target_data_length) != v.target_data_length) - fatal_error ("can%'t read %s: %m", name); + fatal_error (input_location, "can%'t read %s: %m", name); msg = targetm.pch_valid_p (this_file_data, v.target_data_length); free (this_file_data); if (msg != NULL) @@ -435,13 +436,13 @@ c_common_pch_pragma (cpp_reader *pfile, const char *name) fd = open (name, O_RDONLY | O_BINARY, 0666); if (fd == -1) - fatal_error ("%s: couldn%'t open PCH file: %m", name); + fatal_error (input_location, "%s: couldn%'t open PCH file: %m", name); if (c_common_valid_pch (pfile, name, fd) != 1) { if (!cpp_get_options (pfile)->warn_invalid_pch) inform (input_location, "use -Winvalid-pch for more information"); - fatal_error ("%s: PCH file was invalid", name); + fatal_error (input_location, "%s: PCH file was invalid", name); } c_common_read_pch (pfile, name, fd, name); diff --git a/gcc/c-family/cppspec.c b/gcc/c-family/cppspec.c index a49371ad199..55e368b24e6 100644 --- a/gcc/c-family/cppspec.c +++ b/gcc/c-family/cppspec.c @@ -89,7 +89,8 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, case OPT_S: case OPT_c: - fatal_error ("%qs is not a valid option to the preprocessor", + fatal_error (input_location, + "%qs is not a valid option to the preprocessor", decoded_options[i].orig_option_with_args_text); return; @@ -108,7 +109,7 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, seen_input++; if (seen_input == 3) { - fatal_error ("too many input files"); + fatal_error (input_location, "too many input files"); return; } else if (seen_input == 2) |