#314 Java STRING_ARRAY typemap 'in' doesn't initialize size

closed-accepted
None
5
2014-08-20
2012-04-30
Leo Davis
No

I copied the new 'various.i' from SWIG 2.0.6 into my SWIG 2.0.4 installation to try out the fixes for Bug 3521811.
The fixes for the typemap 'in' generated some new warnings for me:

./xxx_wrap.c: In function 'Java_com_xyz_method':
./xxx_wrap.c:900: warning: 'size3' may be used uninitialized in this function

Which is this line of code:

for (i=0; i<size3-1; i++)

from typemap 'freearg'. After looking at the entire output of SWIG for that method, 'size3'
is not initialized in the case in typemap 'in' where $input is NULL. This patch to typemap 'in' initializes it, and fixes the compiler warning.
Thanks for your very fast response to my last report!

Discussion

  • Leo Davis
    Leo Davis
    2012-04-30

    Patch which fixes the compiler warning

     
  • Leo Davis
    Leo Davis
    2012-04-30

    I forgot to mention that the patch is based on SWIG 2.0.6.

     
  • William Fulton
    William Fulton
    2012-05-11

    Thanks, applied for swig-2.0.7.

     
  • William Fulton
    William Fulton
    2012-05-11

    • assigned_to: nobody --> wsfulton
    • status: open --> closed-accepted