This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/41219] libgfortran build warnings



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]