This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47394] Internal compiler error when error count limit is reached
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jan 2011 13:18:16 +0000
- Subject: [Bug fortran/47394] Internal compiler error when error count limit is reached
- Auto-submitted: auto-generated
- References: <bug-47394-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47394
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-01-21 13:17:55 UTC ---
This seems to be a Windows / MinGW specific problem caused by the way gfortran
returns when a fatal error occurs.
gfortran just calls
exit(3);
which according to Kai matches Windows' abort status code.
The proper way seems to use the system.h's exit codes: FATAL_EXIT_CODE,
EXIT_SUCCESS and EXIT_FAILURE instead of hard-coded error codes.
The error message itself is printed by the driver (gcc.c, gfortran.exe) and not
by the proper compiler (f951.exe).
Draft patch:
diff --git a/gcc/fortran/error.c b/gcc/fortran/error.c
index 3092828..8520e2a 100644
--- a/gcc/fortran/error.c
+++ b/gcc/fortran/error.c
@@ -941,3 +941,3 @@ gfc_error_now (const char *gmsgid, ...)
if (flag_fatal_errors)
- exit (1);
+ exit (EXIT_FAILURE);
}
@@ -958,3 +958,3 @@ gfc_fatal_error (const char *gmsgid, ...)
- exit (3);
+ exit (FATAL_EXIT_CODE);
}
@@ -1021,3 +1021,3 @@ gfc_error_check (void)
if (flag_fatal_errors)
- exit (1);
+ exit (EXIT_FAILURE);
}
diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c
index c226bae..d4388e0 100644
--- a/gcc/fortran/scanner.c
+++ b/gcc/fortran/scanner.c
@@ -1870,3 +1870,3 @@ include_line (gfc_char_t *line)
if (load_file (filename, NULL, false) == FAILURE)
- exit (1);
+ exit (EXIT_FAILURE);
@@ -2074,3 +2074,3 @@ gfc_new_file (void)
- exit (0);
+ exit (EXIT_SUCCESS);
#endif