From 9daa9346e2bfca4aa8ef6c459cf9ad8ccf81a8c9 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 16 Feb 2018 16:05:31 +0100 Subject: [PATCH] build: disable -Wgnu-variable-sized-type-not-at-end for systemd code clang 5.0.1 complains: src/systemd/src/libsystemd-network/dhcp6-option.c:40:28: error: field 'option' with variable sized type 'struct DHCP6Option' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end] struct DHCP6Option option; ^ systemd disables this warning too. --- Makefile.am | 1 + configure.ac | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Makefile.am b/Makefile.am index 7688695eec..c19acb2730 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1225,6 +1225,7 @@ src_libsystemd_nm_la_cppflags = \ -I$(srcdir)/src/systemd/src/shared \ -I$(srcdir)/src/systemd/src/libsystemd-network \ -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_SYSTEMD \ + $(LIBSYSTEMD_NM_CFLAGS) \ $(GLIB_CFLAGS) \ $(CODE_COVERAGE_CFLAGS) diff --git a/configure.ac b/configure.ac index 3fd4090a7e..7c6e62007e 100644 --- a/configure.ac +++ b/configure.ac @@ -1097,6 +1097,9 @@ fi NM_COMPILER_WARNINGS(CFLAGS, ${more_warnings_default}) +NM_COMPILER_FLAG(LIBSYSTEMD_NM_CFLAGS, "-Wno-gnu-variable-sized-type-not-at-end") +AC_SUBST(LIBSYSTEMD_NM_CFLAGS) + CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -fno-strict-aliasing \ ])