]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix for PR middle-end/20364, backported from mainline.
authorJames E Wilson <wilson@specifixinc.com>
Wed, 9 Mar 2005 01:00:56 +0000 (01:00 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 9 Mar 2005 01:00:56 +0000 (17:00 -0800)
Backport from mainline
2004-04-13  James E Wilson  <wilson@specifixinc.com>
PR middle-end/20364
* c-opt.c (c_common_post_options): If this_input_filename is NULL,
increment errorcount and return false instead of true.

From-SVN: r96152

gcc/ChangeLog
gcc/c-opts.c

index c730b50365ae66c4c9fee985f7ba0018c1205bbc..edd266eb67021f2f8bbe41aa09b68b1976125c36 100644 (file)
@@ -1,5 +1,11 @@
 2005-03-08  James E Wilson  <wilson@specifixinc.com>
 
+       Backport from mainline
+       2004-04-13  James E Wilson  <wilson@specifixinc.com>
+       PR middle-end/20364
+       * c-opt.c (c_common_post_options): If this_input_filename is NULL,
+       increment errorcount and return false instead of true.
+
        Backport from mainline
        2005-02-21  James E Wilson  <wilson@specifixinc.com>
        * toplev.c (backend_init): Don't call init_adjust_machine_modes here.
index b7da95f6290fa1f37397eead5681ef7bd55fe13d..2a617447cfdb00225490ca6d691d89b965a20f5f 100644 (file)
@@ -1168,8 +1168,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)