This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, libfortran] Silence compiler warning
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: fortran at gcc dot gnu dot org
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 13 May 2008 22:00:19 +0200
- Subject: [patch, libfortran] Silence compiler warning
Hello world,
the patch below silences the only compiler warning on i686-pc-linux-gnu
when building libfortran, about the possibility of "type" being
clobbered by setjmp / longjmp.
I'll commit within 24 hours as obvious unless anybody objects.
Thomas
2008-05-13 Thomas Koenig <tkoenig@gcc.gnu.org>
* io/list_read.c (list_formatted_read_scalar): Declare
type as volatile to shut up compiler warning.
Index: /home/ig25/gcc/trunk/libgfortran/io/list_read.c
===================================================================
--- /home/ig25/gcc/trunk/libgfortran/io/list_read.c (revision 134952)
+++ /home/ig25/gcc/trunk/libgfortran/io/list_read.c (working copy)
@@ -1737,8 +1737,8 @@ 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,
- size_t size)
+list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type, void *p,
+ int kind, size_t size)
{
char c;
int m;