Commit cd445b54 by Martin Liska Committed by Martin Liska

Error for '-' as filename of a precompiled header (PR pch/78970)

2017-01-05  Martin Liska  <mliska@suse.cz>

	PR pch/78970
	* c-opts.c (c_common_post_options): Reject '-' filename for a precompiled
	header.
2017-01-05  Martin Liska  <mliska@suse.cz>

	PR pch/78970
	* gcc.c (lookup_compiler): Reject '-' filename for a precompiled
	header.

From-SVN: r244103
parent abbaf885
2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970
* gcc.c (lookup_compiler): Reject '-' filename for a precompiled
header.
2017-01-05 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
* config/s390/s390.c (s390_expand_setmem): Unroll the loop for
......
2017-01-05 Martin Liska <mliska@suse.cz>
PR pch/78970
* c-opts.c (c_common_post_options): Reject '-' filename for a precompiled
header.
2017-01-04 Marek Polacek <polacek@redhat.com>
PR c++/64767
......
......@@ -744,7 +744,12 @@ c_common_post_options (const char **pfilename)
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 = "";
......
......@@ -8325,7 +8325,16 @@ lookup_compiler (const char *name, size_t length, const char *language)
{
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment