Code

python plugin: Disable strict aliasing.
authorFlorian Forster <octo@huhu.verplant.org>
Mon, 3 May 2010 07:22:39 +0000 (09:22 +0200)
committerFlorian Forster <octo@huhu.verplant.org>
Mon, 3 May 2010 07:24:46 +0000 (09:24 +0200)
"Py_True" and "Py_False" have some weird implementation that GCC can't cope
with. Disable strict aliasing (and warnings relating to it) in order to avoid
those problems at the cost of optimization.

src/Makefile.am

index 5290ab3bae5a97bbb206e239483d83107fbddb77..2a32ece82ea621469bacf0b75b2493e06f6dcbc4 100644 (file)
@@ -853,6 +853,10 @@ if BUILD_PLUGIN_PYTHON
 pkglib_LTLIBRARIES += python.la
 python_la_SOURCES = python.c pyconfig.c pyvalues.c cpython.h
 python_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_PYTHON_CPPFLAGS)
+python_la_CFLAGS = $(AM_CFLAGS)
+if COMPILER_IS_GCC
+python_la_CFLAGS += -fno-strict-aliasing -Wno-strict-aliasing
+endif
 python_la_LDFLAGS = -module -avoid-version $(BUILD_WITH_PYTHON_LDFLAGS)
 python_la_LIBADD = $(BUILD_WITH_PYTHON_LIBS)
 collectd_LDADD += "-dlopen" python.la