Description of problem: I'm trying to write a language binding for R for graphviz. I'm successfully using swig to generate ~10 other language bindings. "swig -c++ -r gv.i" generates bad code: - Missing: #include <stdlib.h> - error: invalid conversion from ‘const char*’ to ‘char*’ - error: invalid conversion from ‘void*’ to ‘char*’ Version-Release number of selected component (if applicable): swig-1.3.31-1.fc8.x86_64 gcc-c++-4.1.2-34.x86_64 R-2.6.1-1.fc9.x86_64 How reproducible: 100% Steps to Reproduce: 1. grab attached: Makefile, gv.i 2. make 3. Actual results: gv_r.cpp: In function ‘RCallbackFunctionData* R_SWIG_pushCallbackFunctionData(SEXPREC*, SEXPREC*)’: gv_r.cpp:759: error: ‘calloc’ was not declared in this scope gv_r.cpp: In function ‘void R_SWIG_popCallbackFunctionData(int)’: gv_r.cpp:800: error: ‘free’ was not declared in this scope gv_r.cpp: In function ‘void R_SWIG_ReferenceFinalizer(SEXPREC*)’: gv_r.cpp:888: error: ‘free’ was not declared in this scope gv_r.cpp: In function ‘SEXPREC* RSwigPacked_New(void*, size_t, swig_type_info*)’: gv_r.cpp:1000: error: ‘malloc’ was not declared in this scope gv_r.cpp: In function ‘int SWIG_AsCharPtrAndSize(SEXPREC*, char**, size_t*, int*)’: gv_r.cpp:1393: error: invalid conversion from ‘const char*’ to ‘char*’ .... Expected results: no errors or warnings from swig generated code Additional info:
Created attachment 271381 [details] Makefile
Created attachment 271391 [details] gv.i swig source file
Looks like fixed in latest upstream. Could you please test http://kojiweb.fedoraproject.org/koji/taskinfo?taskID=265131 ? Works for me. Thanks
after tests fixed in swig-1.3.33-1.fc{7,8,9}
Much better, thanks. Also no apparent new breakage to the other swig-generated language bindings for graphviz. gv_r.cpp:725:2: warning: #warning "R Swig currently fails on runtime for 2.6 and higher." gv_r.cpp:726:2: warning: #warning "Contact maintainer if you would like to help fix" When I understand what this is about I'll take it up with the R maintainer.
I'm not sure what exactly that warning mean. Tell it to R maintainer and if he tells this is swig problem let me know Thanks