Hi,

on my system, --embed does not work with --cplus.

How to reproduce: Any valid pyx file works:

$ rm -f test.pyx; touch test.pyx
$ cython --embed --cplus test.pyx
$ g++ -c test.cpp -I/usr/include/python3.4m
test.cpp: In function ‘wchar_t* __Pyx_char2wchar(char*)’:
test.cpp:945:41: error: invalid conversion from ‘void*’ to ‘wchar_t*’
[-fpermissive]
     res = malloc(argsize*sizeof(wchar_t));
$ clang++ -c test.cpp -I/usr/include/python3.4m
test.cpp:945:9: error: assigning to 'wchar_t *' from incompatible type
'void *'
    res = malloc(argsize*sizeof(wchar_t));


The issue can easily be fixed by manually casting the malloc result to
(wchar_t *).
In C it is not recommended to cast the malloc result, while in C++ it is
required (and malloc is discouraged).

System info:

$ cython --version
Cython version 0.21.1
$ g++ --version
g++ (Debian 4.9.2-2) 4.9.2
$ python3 --version
Python 3.4.2
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux unstable (sid)
Release:        unstable
Codename:       sid

~ Michael

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel

Reply via email to