[Patch, fortran]: prevent clobbered by 'longjmp' or 'vfork

Jack Howarth howarth@bromo.msbb.uc.edu
Sun Oct 1 23:51:00 GMT 2006


The attached patch eliminates a warning of...

../../../gcc-4.2-20060928/libgfortran/io/list_read.c: In function 'list_formatted_read_scalar':
../../../gcc-4.2-20060928/libgfortran/io/list_read.c:1460: warning: argument 'type' might be clobbered by 'longjmp' or 'vfork'

which occurs on Darwin/ppc, Linux/ppc and Linux/x86-64. The
fix has be confirmed as the correct approach by Andreas Jaeger.
I have bootstrap and regression tested this patch on
Darwin/PPC. Okay for trunk?
             Jack

2006-10-01  Jack Howarth  <howarth@bromo.med.uc.edu>

	* io/list_read.c (list_formatted_read_scalar): 
	Make type volatile.

Index: io/list_read.c
===================================================================
--- io/list_read.c	(revision 117347)
+++ io/list_read.c	(working copy)
@@ -1457,7 +1457,7 @@ check_type (st_parameter_dt *dtp, bt typ
    greater than one, we copy the data item multiple times.  */
 
 static void
-list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, int kind,
+list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type, void *p, int kind,
 			    size_t size)
 {
   char c;



More information about the Fortran mailing list