Compile rpcgen-generated files with -fno-strict-aliasing
authorMatthew Booth <mbooth@redhat.com>
Thu, 7 Apr 2011 14:30:54 +0000 (15:30 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Thu, 7 Apr 2011 15:37:20 +0000 (16:37 +0100)
rpcgen generates source which can't be safely compiled with strict-aliasing
enabled.

daemon/Makefile.am
fish/Makefile.am
src/Makefile.am

index ee1959f..8fb070f 100644 (file)
@@ -45,13 +45,12 @@ BUILT_SOURCES = \
 EXTRA_DIST = $(BUILT_SOURCES) \
        .gitignore
 
 EXTRA_DIST = $(BUILT_SOURCES) \
        .gitignore
 
-# This convenience library is solely to avoid compiler warnings
-# in its generated sources.
 noinst_LIBRARIES = libprotocol.a
 noinst_LIBRARIES = libprotocol.a
-libprotocol_a_SOURCES = \
-       guestfs_protocol.c \
-       guestfs_protocol.h
-libprotocol_a_CFLAGS =
+
+# This convenience library is solely to compile its generated sources with
+# custom flags.
+libprotocol_a_SOURCES = guestfs_protocol.c guestfs_protocol.h
+libprotocol_a_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing
 
 guestfs_protocol.c: $(libsrcdir)/guestfs_protocol.c
        rm -f $@
 
 guestfs_protocol.c: $(libsrcdir)/guestfs_protocol.c
        rm -f $@
index 6c85671..f6354c4 100644 (file)
@@ -99,10 +99,10 @@ guestfish_SOURCES = \
        tilde.c \
        time.c
 
        tilde.c \
        time.c
 
-# This convenience library is solely to avoid compiler warnings
-# in its generated sources.
-librc_protocol_la_SOURCES = rc_protocol.c
-librc_protocol_la_CFLAGS = -Wall -Wno-unused
+# This convenience library is solely to compile its generated sources with
+# custom flags.
+librc_protocol_la_SOURCES = rc_protocol.c rc_protocol.h
+librc_protocol_la_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing
 
 # Build the command lookup perfect hash code.  The generated code has
 # lots of warnings so we must compile it in a separate mini-library.
 
 # Build the command lookup perfect hash code.  The generated code has
 # lots of warnings so we must compile it in a separate mini-library.
index 3e1201d..42cc906 100644 (file)
@@ -52,13 +52,10 @@ include_HEADERS = guestfs.h
 
 lib_LTLIBRARIES = libguestfs.la
 
 
 lib_LTLIBRARIES = libguestfs.la
 
-# This convenience library is solely to avoid compiler warnings
-# in its generated sources.
-libprotocol_la_SOURCES = \
-  guestfs_protocol.c \
-  guestfs_protocol.h
-
-libprotocol_la_CFLAGS =
+# This convenience library is solely to compile its generated sources with
+# custom flags.
+libprotocol_la_SOURCES = guestfs_protocol.c  guestfs_protocol.h
+libprotocol_la_CFLAGS = -Wall -Wno-unused -fno-strict-aliasing
 
 # Build the errnostring perfect hash code.  The generated code has lots
 # of warnings so we must compile it in a separate mini-library.
 
 # Build the errnostring perfect hash code.  The generated code has lots
 # of warnings so we must compile it in a separate mini-library.