2017-01-10 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970
* gcc.c (lookup_compiler): Reject '-' filename for a precompiled
header.
2017-01-10 Martin Liska <mliska@suse.cz>
Backport from mainline
2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970
* c-opts.c (c_common_post_options): Reject '-' filename for a precompiled
header.
From-SVN: r244267
+2017-01-10 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-05 Martin Liska <mliska@suse.cz>
+
+ PR pch/78970
+ * gcc.c (lookup_compiler): Reject '-' filename for a precompiled
+ header.
+
2017-01-10 Chung-Ju Wu <jasonwucj@gmail.com>
Backport from mainline
+2017-01-10 Martin Liska <mliska@suse.cz>
+
+ Backport from mainline
+ 2017-01-05 Martin Liska <mliska@suse.cz>
+
+ PR pch/78970
+ * c-opts.c (c_common_post_options): Reject '-' filename for a precompiled
+ header.
+
2016-07-07 Jakub Jelinek <jakub@redhat.com>
Backported from mainline
in_fnames[0] = "";
}
else if (strcmp (in_fnames[0], "-") == 0)
- in_fnames[0] = "";
+ {
+ if (pch_file)
+ error ("cannot use %<-%> as input filename for a precompiled header");
+
+ in_fnames[0] = "";
+ }
if (out_fname == NULL || !strcmp (out_fname, "-"))
out_fname = "";
{
for (cp = compilers + n_compilers - 1; cp >= compilers; cp--)
if (cp->suffix[0] == '@' && !strcmp (cp->suffix + 1, language))
- return cp;
+ {
+ if (name != NULL && strcmp (name, "-") == 0
+ && (strcmp (cp->suffix, "@c-header") == 0
+ || strcmp (cp->suffix, "@c++-header") == 0))
+ fatal_error (input_location,
+ "cannot use %<-%> as input filename for a "
+ "precompiled header");
+
+ return cp;
+ }
error ("language %s not recognized", language);
return 0;