This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[gfortran, committed] Fix segfault in PR16336
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: GCC Fortran mailing list <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 10 Jul 2004 18:30:13 +0200
- Subject: [gfortran, committed] Fix segfault in PR16336
This patch which I commit under the obviously correct rule, fixes a bug
with error reporting: gfc_match_common used to call gfc_error with '%s'
in the format string, but no argument to go with that format item. D'oh.
I verified that the error message is now emitted correctly, and also
looked through match.c to find other omissions of the same type.
I'm inclined to believe that the code in PR 16336 is indeed invalid, but
I will double check the standard to make sure that this is true.
Built and tested on i686-pc-linux.
- Tobi
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/ChangeLog,v
retrieving revision 1.109
diff -u -p -r1.109 ChangeLog
--- ChangeLog 10 Jul 2004 12:45:33 -0000 1.109
+++ ChangeLog 10 Jul 2004 16:19:00 -0000
@@ -3,6 +3,9 @@
* expr.c (gfc_check_pointer_assign): Verify that rank of the LHS
and RHS match. Return early if the RHS is NULL().
+ PR fortran/16336
+ * match.c (match_common): Fix error reporting for used common.
+
2004-07-10 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* trans-common.c: Fix whitespace issues, make variable names
Index: match.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fortran/match.c,v
retrieving revision 1.15
diff -u -p -r1.15 match.c
--- match.c 1 Jul 2004 07:50:18 -0000 1.15
+++ match.c 10 Jul 2004 16:19:00 -0000
@@ -2146,7 +2146,7 @@ gfc_match_common (void)
if (t->use_assoc)
{
gfc_error ("COMMON block '%s' at %C has already "
- "been USE-associated");
+ "been USE-associated", name);
goto cleanup;
}
}