+2009-03-31 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/15638
+ * c-common.c (c_cpp_error): Handle CPP_DL_FATAL.
+
2009-03-31 Richard Guenther <rguenther@suse.de>
PR middle-end/23401
case CPP_DL_NOTE:
dlevel = DK_NOTE;
break;
+ case CPP_DL_FATAL:
+ dlevel = DK_FATAL;
+ break;
default:
gcc_unreachable ();
}
+2009-03-31 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/15638
+ * cpp.c (cb_cpp_error): Handle CPP_DL_FATAL.
+
2009-03-30 Steven G. Kargl <kargls@comcast.net>
PR fortran/38389
case CPP_DL_NOTE:
dlevel = DK_NOTE;
break;
+ case CPP_DL_FATAL:
+ dlevel = DK_FATAL;
+ break;
default:
gcc_unreachable ();
}
+2009-03-31 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/15638
+ * gcc.dg/cpp/missing-header-1.c: New test.
+ * gcc.dg/cpp/include2.c: Only test #include <>. Expect
+ "compilation terminated" message.
+ * gcc.dg/cpp/include2a.c: New test. Copy of include2.c but only
+ test #include "".
+ * gcc.dg/pch/counter-2.c, gcc.dg/pch/valid-1.c,
+ gcc.dg/pch/valid-2.c, gcc.dg/pch/warn-1.c: Expect "compilation
+ terminated" message.
+
2009-03-31 Richard Guenther <rguenther@suse.de>
PR middle-end/23401
/* Source: Neil Booth, 4 Nov 2000. */
#include <silly\>> /* { dg-error "extra tokens" "" } */
-#include "silly\"" /* { dg-error "extra tokens" "" } */
/* These error is No such file or directory, just once. However, this
message is locale-dependent, so don't test for it. */
/* { dg-error "silly" "" { target *-*-* } 10 } */
-/* { dg-error "missing" "" { target *-*-* } 11 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
--- /dev/null
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Tests that #include does not allow the terminating '>' or '"' to be
+ escaped, as per the standard. */
+
+/* Source: Neil Booth, 4 Nov 2000. */
+
+#include "silly\"" /* { dg-error "extra tokens" "" } */
+
+/* These error is No such file or directory, just once. However, this
+ message is locale-dependent, so don't test for it. */
+/* { dg-error "silly" "" { target *-*-* } 10 } */
+/* { dg-error "missing" "" { target *-*-* } 10 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
--- /dev/null
+/* Test that missing headers are fatal errors. PR 15638. */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#include "nonexistent.h" /* { dg-error "nonexistent.h" } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
+
+/* This declaration should not receive any diagnostic. */
+foo bar;
#include "counter-2.h" /* { dg-warning "not used because `__COUNTER__' is invalid" } */
/* { dg-error "counter-2.h: No such file or directory" "no such file" { target *-*-* } 10 } */
/* { dg-error "one or more PCH files were found, but they were invalid" "invalid files" { target *-*-* } 10 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
int main(void)
{
#include "valid-1.h"/* { dg-warning "created with -gnone, but used with -g" } */
/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
int x;
#include "valid-2.h" /* { dg-warning "settings for -fexceptions do not match" } */
/* { dg-error "No such file" "no such file" { target *-*-* } 3 } */
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 3 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
int x;
#include "warn-1.h"/* { dg-warning "not used because .DEFINED_VALUE. is defined" } */
/* { dg-error "No such file" "no such file" { target *-*-* } 5 } */
/* { dg-error "they were invalid" "invalid files" { target *-*-* } 5 } */
+/* { dg-message "terminated" "" { target *-*-* } 0 } */
int main(void)
+2009-03-31 Joseph Myers <joseph@codesourcery.com>
+
+ PR preprocessor/15638
+ * files.c (_cpp_find_file): Call open_file_failed after diagnosing
+ invalid PCH.
+ (open_file_failed): Make error for missing file fatal.
+ * include/cpplib.h (CPP_DL_FATAL): Define.
+
2009-03-30 Sergiy Vyshnevetskiy <serg@vostok.net>
PR preprocessor/31932:
/* Part of CPP library. File handling.
Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
Written by Per Bothner, 1994.
Based on CCCP program by Paul Rubin, June 1986
return file;
}
- open_file_failed (pfile, file, angle_brackets);
if (invalid_pch)
{
cpp_error (pfile, CPP_DL_ERROR,
cpp_error (pfile, CPP_DL_ERROR,
"use -Winvalid-pch for more information");
}
+ open_file_failed (pfile, file, angle_brackets);
break;
}
if (CPP_OPTION (pfile, deps.style) && ! print_dep)
cpp_errno (pfile, CPP_DL_WARNING, file->path);
else
- cpp_errno (pfile, CPP_DL_ERROR, file->path);
+ cpp_errno (pfile, CPP_DL_FATAL, file->path);
}
}
#define CPP_DL_ICE 0x04
/* An informative note following a warning. */
#define CPP_DL_NOTE 0x05
+/* A fatal error. */
+#define CPP_DL_FATAL 0x06
/* Output a diagnostic of some kind. */
extern bool cpp_error (cpp_reader *, int, const char *msgid, ...)