summaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-14 06:07:27 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-14 06:07:27 +0000
commit75d034d9a8243052965e32e7d48fff5b3a31385c (patch)
tree259e4e2b6f1db319564423c1ce431cd891460cf8 /gcc/c-opts.c
parent616d4baf35ad7b3f482877d2b001fdd49388d83d (diff)
downloadgcc-75d034d9a8243052965e32e7d48fff5b3a31385c.tar.gz
Fix problem reported by Dan Berlin on gcc list.
* c-opt.c (c_common_post_options): If this_input_filename is NULL, increment errorcount and return false instead of true. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80678 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 7aa21c4458f..c63913671fb 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -1171,8 +1171,12 @@ c_common_post_options (const char **pfilename)
*pfilename = this_input_filename
= cpp_read_main_file (parse_in, in_fnames[0]);
+ /* Don't do any compilation or preprocessing if there is no input file. */
if (this_input_filename == NULL)
- return true;
+ {
+ errorcount++;
+ return false;
+ }
if (flag_working_directory
&& flag_preprocess_only && ! flag_no_line_commands)