Menu

#684 3d array assignment generates invalid c++

None
closed-duplicate
5
2022-02-02
2006-05-31
No

test.i:
%module Test
%include "test.h"
%{
#include "test.h"
%}

test.h:
struct TestStruct {
double coeffs[3][3][2];
};

The generated wrapper gives the following error:

test.cc: In function `PyObject*
_wrap_TestStruct_coeffs_set(PyObject*, PyObject*)':
test.cc:2588: error: ISO C++ forbids assignment of
arrays

I'm using SWIG 1.3.29 and gcc 3.4.5. Interestingly,
SWIG 1.3.25 produces compilable code.

Discussion

  • Olly Betts

    Olly Betts - 2006-09-25

    Logged In: YES
    user_id=14972

    Thanks for your bug report.

    I've done some investigating, but not found a fix yet. I'm
    going to leave this for now, but here are my findings in
    case somebody else wants to look.

    SWIG 1.3.27 also produces compilable code.

    And it's not python-specific - PHP also produces compilable
    code with 1.3.27 but not with CVS HEAD.

     
  • Olly Betts

    Olly Betts - 2022-02-02
    • status: open --> closed-duplicate
    • Group: -->
     
  • Olly Betts

    Olly Betts - 2022-02-02

    Still present, but we also have a ticket for this in the tracker we use now so closing this as a duplicate:

    https://github.com/swig/swig/issues/142

     

Log in to post a comment.