[sr-dev] app_python compilation warnings fix
Ovidiu Sas
osas at voipembedded.com
Mon Dec 3 04:30:31 CET 2012
Hello Konstantin,
I tested your patch and I pushed your patches:
Commit: 6a45c8eba310afa9b8173c0522d77e7a574ddc52
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6a45c8eba310afa9b8173c0522d77e7a574ddc52
Author: Konstantin M <evilzluk at gmail.com>
Committer: Ovidiu Sas <osas at voipembedded.com>
Date: Sun Dec 2 22:21:05 2012 -0500
Thanks for the contribution,
Ovidiu Sas
On Sun, Dec 2, 2012 at 6:56 PM, Konstantin M. <evilzluk at gmail.com> wrote:
> Next patch for fixing:
>
> CC (gcc) [M app_python.so] python_msgobj.o
> python_msgobj.c: In function ‘python_msgobj_init’:
> python_msgobj.c:530:5: warning: dereferencing type-punned pointer will break
> strict-aliasing rules [-Wstrict-aliasing]
>
>
>
> 2012/12/3 Konstantin M. <evilzluk at gmail.com>
>
>> Hello dev team,
>>
>> I'm trying to compile app_python under kamailio 3.3.2 and gcc (Debian
>> 4.7.2-4) 4.7.2 and I'm getting a bunch of warnings like:
>> CC (gcc) [M app_python.so] python_exec.o
>> CC (gcc) [M app_python.so] python_iface.o
>> In file included from /usr/include/python2.7/Python.h:8:0,
>> from python_iface.c:28:
>> /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE"
>> redefined [enabled by default]
>> In file included from /usr/include/i386-linux-gnu/sys/types.h:26:0,
>> from ../../route_struct.h:45,
>> from ../../action.h:42,
>> from python_iface.c:23:
>> /usr/include/features.h:214:0: note: this is the location of the previous
>> definition
>> CC (gcc) [M app_python.so] python_mod.o
>> In file included from /usr/include/python2.7/Python.h:8:0,
>> from python_iface.h:26,
>> from python_mod.c:27:
>> /usr/include/python2.7/pyconfig.h:1161:0: warning: "_POSIX_C_SOURCE"
>> redefined [enabled by default]
>> In file included from /usr/include/dlfcn.h:23:0,
>> from ../../sr_module.h:60,
>> from python_mod.c:24:
>> /usr/include/features.h:214:0: note: this is the location of the previous
>> definition
>>
>> ...
>>
>>
>> According to the Python documentation
>> (http://docs.python.org/c-api/intro.html#includes), the include directive
>> for “Python.h” should appear first in the C/C++ file.
>> It doesn’t sound like a good idea to require this, but if you don’t put
>> “Python.h” first, you might get compiler warnings like I mentioned above.
>>
>> I've made a diff (against kamailio-3.3.2) for fixing that.
>> See attached.
More information about the sr-dev
mailing list