aboutsummaryrefslogtreecommitdiff
path: root/gcc/diagnostic.c
diff options
context:
space:
mode:
authorAnthony Brandon <anthony.brandon@gmail.com>2014-11-11 23:33:25 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2014-11-11 23:33:25 +0000
commit3d00119cfbbcadccb56e5a0b8fe447ad7554d681 (patch)
treed4db9e599db1d46abb0414b25660560c2823a504 /gcc/diagnostic.c
parent3aa34c1d8f94fc56d66de3b8d09dbd8c2c9e8525 (diff)
downloadgcc-3d00119cfbbcadccb56e5a0b8fe447ad7554d681.zip
gcc-3d00119cfbbcadccb56e5a0b8fe447ad7554d681.tar.gz
gcc-3d00119cfbbcadccb56e5a0b8fe447ad7554d681.tar.bz2
re PR driver/36312 (should refuse to overwrite input file with output file)
gcc/testsuite/ChangeLog: 2014-11-11 Anthony Brandon <anthony.brandon@gmail.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR driver/36312 * gcc.misc-tests/output.exp: New test case for identical input and output files. include/ChangeLog: 2014-11-11 Anthony Brandon <anthony.brandon@gmail.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR driver/36312 * filenames.h: Add prototype for canonical_filename_eq. gcc/ChangeLog: 2014-11-11 Anthony Brandon <anthony.brandon@gmail.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR driver/36312 * diagnostic-core.h: Add prototype for fatal_error. * diagnostic.c (fatal_error): New function fatal_error. * gcc.c (store_arg): Remove have_o_argbuf_index. (process_command): Check if input and output files are the same. * toplev.c (init_asm_output): Check if input and output files are the same. libiberty/ChangeLog: 2014-11-11 Anthony Brandon <anthony.brandon@gmail.com> Manuel López-Ibáñez <manu@gcc.gnu.org> PR driver/36312 * filename_cmp.c (canonical_filename_eq): New function to check if file names are the same. * functions.texi: Updated with documentation for new function. Co-Authored-By: Manuel López-Ibáñez <manu@gcc.gnu.org> From-SVN: r217391
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r--gcc/diagnostic.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index 642cbe3..f7f8aaa 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -1163,6 +1163,23 @@ fatal_error (const char *gmsgid, ...)
gcc_unreachable ();
}
+/* An error which is severe enough that we make no attempt to
+ continue. Do not use this for internal consistency checks; that's
+ internal_error. Use of this function should be rare. */
+void
+fatal_error (location_t loc, const char *gmsgid, ...)
+{
+ diagnostic_info diagnostic;
+ va_list ap;
+
+ va_start (ap, gmsgid);
+ diagnostic_set_info (&diagnostic, gmsgid, &ap, loc, DK_FATAL);
+ report_diagnostic (&diagnostic);
+ va_end (ap);
+
+ gcc_unreachable ();
+}
+
/* An internal consistency check has failed. We make no attempt to
continue. Note that unless there is debugging value to be had from
a more specific message, or some other good reason, you should use