[Spice-devel] [PATCH spice-server] build: do not warn about address-of-packed-member

Uri Lublin uril at redhat.com
Tue May 7 09:48:55 UTC 2019


The gcc warning address-of-packed-member is new and on by
default in gcc 9.

Many of the structures sent over the network are packed
and with unaligned fields.

This breaks the build -- due to -Werror.
Tell gcc to not warn about it.

Signed-off-by: Uri Lublin <uril at redhat.com>
---
 m4/manywarnings.m4 | 1 +
 meson.build        | 1 +
 2 files changed, 2 insertions(+)

diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4
index 4f701f4ea..20543d4a4 100644
--- a/m4/manywarnings.m4
+++ b/m4/manywarnings.m4
@@ -174,6 +174,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
     -Wmultichar \
     -Wnarrowing \
     -Wnested-externs \
+    -Wno-address-of-packed-member \
     -Wnonnull \
     -Wnonnull-compare \
     -Wnull-dereference \
diff --git a/meson.build b/meson.build
index 93fbdfff9..b8dde96a8 100644
--- a/meson.build
+++ b/meson.build
@@ -42,6 +42,7 @@ spice_server_global_cflags = ['-DSPICE_SERVER_INTERNAL',
                               '-Wall',
                               '-Wextra',
                               '-Wno-sign-compare',
+                              '-Wno-address-of-packed-member',
                               '-Wno-unused-parameter']
 
 compiler = meson.get_compiler('c')
-- 
2.21.0



More information about the Spice-devel mailing list