#82 tcl/varargs: passing 0/NULL

closed-accepted
nobody
None
5
2004-08-23
2004-08-18
No

swig wrapper code passes the literal ``0'' for null
pointers.
I have run into problems on 64 bit platforms in
SWIG_GetArgs where the varargs function does not zero
out the upper 32 bits when passed a literal 0. This
problem seems to only occur for longer argument lists.
I've seen it with both gnu and Portland Group compilers.

This patch causes wrapper code to instead pass ``NULL''
and this fixes the problem.

this simple patch applies against versions 1.3.19,
1.3.21 and the last cvs snapshot I checked.

Discussion

  • simple patch for Source/Modules/tcl8.cxx

     
    Attachments
  • William Fulton
    William Fulton
    2004-08-23

    • status: open --> closed-accepted
     
  • William Fulton
    William Fulton
    2004-08-23

    Logged In: YES
    user_id=242951

    Patch committed for SWIG-1.3.22. Thanks.

     
  • William Fulton
    William Fulton
    2005-08-23

    Logged In: YES
    user_id=242951

    Not all platforms define NULL as (void*)0, so the fix for
    1.3.26 will contain (void*)0 instead of NULL, see email from
    Jeremy Lin, 22 Jan 205, on swig-dev mailing list.