This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/45629] New: libgfortran/io/list_read.c:1872:10: warning: variable 'elem' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Sep 2010 07:41:36 -0000
- Subject: [Bug fortran/45629] New: libgfortran/io/list_read.c:1872:10: warning: variable 'elem' might be clobbered by 'longjmp' or 'vfork' [-Wclobbered]
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
At least on MinGW64 (as reported by nightstrike), the following warning is
printed when compiling libgfortran:
libgfortran/io/list_read.c:1872:10: warning: variable 'elem' might be clobbered
by 'longjmp' or 'vfork' [-Wclobbered]
If one looks at the source, one sees:
1869 list_formatted_read (st_parameter_dt *dtp, bt type, void *p, int kind,
1870 size_t size, size_t nelems)
1871 {
1872 size_t elem;
[...]
1880 for (elem = 0; elem < nelems; elem++)
1881 {
1882 dtp->u.p.item_count++;
1883 list_formatted_read_scalar (dtp, type, tmp + stride*elem, kind,
size);
with
1704 list_formatted_read_scalar (st_parameter_dt *dtp, volatile bt type,
void *p,
1710 jmp_buf eof_jump;
However, I do not see how "elem" itself gets clobbered - thus the warning looks
bogus to me, but I have only glanced at the code.
--
Summary: libgfortran/io/list_read.c:1872:10: warning: variable
'elem' might be clobbered by 'longjmp' or 'vfork' [-
Wclobbered]
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: burnus at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45629