diff options
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index 9bb225744ef..acb55c5c60a 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -1172,8 +1172,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) @@ -1362,11 +1366,13 @@ sanitize_cpp_opts (void) /* Disable -dD, -dN and -dI if normal output is suppressed. Allow -dM since at least glibc relies on -M -dM to work. */ + /* Also, flag_no_output implies flag_no_line_commands, always. */ if (flag_no_output) { if (flag_dump_macros != 'M') flag_dump_macros = 0; flag_dump_includes = 0; + flag_no_line_commands = 1; } cpp_opts->unsigned_char = !flag_signed_char; |