Fixed strict aliasing. Turn it off only for the callbacks code. When we turn it
authorMonty Taylor <mordred@inaugust.com>
Mon, 6 Jul 2009 17:18:09 +0000 (12:18 -0500)
committerMonty Taylor <mordred@inaugust.com>
Mon, 6 Jul 2009 17:18:09 +0000 (12:18 -0500)
off, also turn off the optimization

configure.ac
libmemcached/Makefile.am
tests/Makefile.am

index 0df44b0a3c4611172115defcdf19429596cf7e99..b2fb9880e3d5e608ece31c61d4b94d5fb14e26b8 100644 (file)
@@ -329,6 +329,7 @@ template <> void C<int>::foo();
         [CXX_WARNINGS="${CXX_WARNINGS} -Wredundant-decls"],
         [CXX_WARNINGS="${CXX_WARNINGS} -Wno-redundant-decls"])
 
+  NO_STRICT_ALIASING="-fno-strict-aliasing -Wno-strict-aliasing"
   NO_REDUNDANT_DECLS="-Wno-redundant-decls"
 fi
 if test "$SUNCC" = "yes"
@@ -364,6 +365,7 @@ fi
 
 AC_SUBST(NO_CONVERSION)
 AC_SUBST(NO_REDUNDANT_DECLS)
+AC_SUBST(NO_STRICT_ALIASING)
 
 AM_CPPFLAGS="-I\$(top_srcdir) -I\$(top_builddir) ${CPPFLAGS}"
 AM_CFLAGS="${CC_WARNINGS} ${CC_PROFILING} ${CC_COVERAGE} ${CFLAGS}"
index b7659eb281dc72650934363906db437c3858fa25..d942704004ab5a09ce46b85016e7bc854075a2ef 100644 (file)
@@ -23,13 +23,17 @@ pkginclude_HEADERS= memcached.h \
                    memcached_storage.h \
                    memcached_string.h \
                    memcached_types.h \
-                   memcached_watchpoint.h
+                   memcached_watchpoint.h \
+                   visibility.h
 
 if BUILD_LIBMEMCACHEDUTIL
 pkginclude_HEADERS+= memcached_util.h memcached_pool.h
 endif
 
 lib_LTLIBRARIES = libmemcached.la
+noinst_LTLIBRARIES = libmemcachedcallbacks.la
+libmemcachedcallbacks_la_CFLAGS = ${AM_CFLAGS} ${NO_STRICT_ALIASING}
+libmemcachedcallbacks_la_SOURCES = memcached_callback.c
 
 libmemcached_la_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} -DBUILDING_LIBMEMCACHED
 libmemcached_la_SOURCES = crc.c \
@@ -37,7 +41,6 @@ libmemcached_la_SOURCES = crc.c \
                          memcached_auto.c \
                          memcached_analyze.c \
                          memcached_behavior.c \
-                         memcached_callback.c \
                          memcached_connect.c \
                          memcached_delete.c \
                          memcached_do.c \
@@ -75,8 +78,8 @@ if BUILD_BYTEORDER
 libmemcached_la_SOURCES += byteorder.c
 endif
 
-libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@
-libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM)
+libmemcached_la_DEPENDENCIES = @DTRACE_OBJ@ libmemcachedcallbacks.la
+libmemcached_la_LIBADD = @DTRACE_OBJ@ $(LIBM) libmemcachedcallbacks.la
 libmemcached_la_LDFLAGS = -version-info $(MEMCACHED_LIBRARY_VERSION) $(LD_VERSION_SCRIPT) $(LIBM)
 
 dtrace_probes.h: libmemcached_probes.d
index 70437c2ed3e26763110ef36381cead2ef45e3fd2..2916350e3d0499e0091bd14fb7eef5f7750c047d 100644 (file)
@@ -21,7 +21,7 @@ LIBS =
 noinst_HEADERS = test.h server.h ketama_test_cases.h
 noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers
 
-testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION}
+testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} ${NO_STRICT_ALIASING}
 testapp_SOURCES = test.c function.c server.c ../clients/generator.c ../clients/execute.c
 testapp_LDADD = $(LDADDS)