http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46140

--- Comment #3 from kargl at gcc dot gnu.org 2010-10-22 21:42:33 UTC ---
A patch as simple as

Index: scanner.c
===================================================================
--- scanner.c   (revision 165861)
+++ scanner.c   (working copy)
@@ -1867,7 +1867,9 @@ include_line (gfc_char_t *line)
                   read by anything else.  */

   filename = gfc_widechar_to_char (begin, -1);
-  load_file (filename, NULL, false);
+  if (load_file (filename, NULL, false) == FAILURE)
+    exit (1);
+  
   gfc_free (filename);
   return true;
 }

gives an exit status

troutmask:sgk[205] gfc4x -o z t.f90
t.f90:2: Error: Can't open included file 'notthere.inc'
troutmask:sgk[206] gfc4x -o z t.f90 ; echo $?
t.f90:2: Error: Can't open included file 'notthere.inc'
1

Reply via email to