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, view it on GitHub, or mute the thread.