[sr-dev] [kamailio/kamailio] app_python warning about strict-aliasing (#1249)

Daniel-Constantin Mierla notifications at github.com
Wed Sep 27 15:51:12 CEST 2017


Tracking here the issue exposed by @linuxmaniac via PR #924, as it was merged and then reverted (by #1248), so anyone can be aware of as well as comment/propose solutions for it.

>    Add "-fno-strict-aliasing" to compilation flags
>
>    Fixes a slew of:
>      "dereferencing type-punned pointer will break strict-aliasing rules"
>    warnings from GCC for lines of the form:
>      Py_INCREF(Py_True);
>    and
>      Py_INCREF(Py_False);
>
>    due to the cast from PyIntObject* to PyObject*
>
>    GCC is technically correct here; see:
>      http://www.python.org/dev/peps/pep-3123/
>    though this is unlikely to lead to non-working machine code.

The initial proposed patch for `src/modules/app_python/Makefile` is:

```

 @@ -22,6 +22,8 @@ ifeq ($(OS), freebsd)
  LIBS+=-pthread
  endif
  
 +# python2 https://www.python.org/dev/peps/pep-3123/
 +DEFS+=-fno-strict-aliasing
  DEFS+=-I${PYTHON_INCDIR}
  DEFS+=-DKAMAILIO_MOD_INTERFACE
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1249
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20170927/5462097c/attachment.html>


More information about the sr-dev mailing list