coin3d / pivy

python bindings to coin3d
ISC License
53 stars 37 forks source link

-fpermissive required to compile Swig generated cpp files #62

Open kkremitzki opened 4 years ago

kkremitzki commented 4 years ago

David Daish created an issue 2019-03-05

When the build script reached the point where the Swig generated coin_wrap.cpp files are compiled by GCC, the build would fail if it wasn't also given the flag -fpermissive.

I'm not an expert, but I believe this is unsafe, and I felt it appropriate to document this here.

Comments (1)

    John Soo

    I am experiencing this as well. Here is the error gcc gives:

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/gnu/store/b7fqhszxl02g6pfm3vw6b3cjz472qrly-python-3.7.0/include/python3.7m -c pivy/coin_wrap.cpp -o build/temp.linux-x86_64-3.7/pivy/coin_wrap.o -Iinterfaces -I/gnu/store/l6mkj46jllqwl6i9ywzl0k5ks760wf30-coin3D-4.0.0a-1.8d860d7/include -I/gnu/store/l6mkj46jllqwl6i9ywzl0k5ks760wf30-coin3D-4.0.0a-1.8d860d7/include/Inventor/annex -Wno-unused -Wno-maybe-uninitialized
    pivy/coin_wrap.cpp: In function ‘void SoSensorPythonCB(void*, SoSensor*)’:
    pivy/coin_wrap.cpp:6342:40: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
         sensor_cast_name = PyUnicode_AsUTF8(item);
                                            ^
    pivy/coin_wrap.cpp: In function ‘void SoMarkerSet_addMarker__SWIG_3(int, const SbVec2s&, PyObject*, SbBool, SbBool)’:
    pivy/coin_wrap.cpp:7236:43: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
                 coin_marker = PyUnicode_AsUTF8(string);
                                               ^
    error: command 'gcc' failed with exit status 1