This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41219] libgfortran build warnings
- From: "nightstrike at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Sep 2009 17:36:34 -0000
- Subject: [Bug fortran/41219] libgfortran build warnings
- References: <bug-41219-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from nightstrike at gmail dot com 2009-09-21 17:36 -------
(In reply to comment #17)
> > ../../../../../build/gcc/gcc/libgfortran/intrinsics/iso_c_binding.c:98:24:
> > warning: 'str' may be used uninitialized in this function
>
> I think this warning is bogus:
> index_type size, str;
> for (i = 0; i < shapeSize; i++)
> {
> if (i == 0)
> str = 1;
> else
> str = str * GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1);
> But one could add a "str = 1" to silence the compiler ...
This looks dumb to begin with. Just initialize str to 1 and run the for-loop
from 1 to shapeSize. Starting at 0 and special casing zero is absurd.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41219