2021-02-17 Timm Bäder <tbaeder@redhat.com>
+ * configure.ac: Add -Wno-packed-not-aligned check.
+
+2021-02-17 Timm Bäder <tbaeder@redhat.com>
+
* configure.ac: Add -Wtrampolines check.
2021-02-05 Mark Wielaard <mark@klomp.org>
2021-02-17 Timm Bäder <tbaeder@redhat.com>
+ * eu.am (NO_PACKED_NOT_ALIGNED_WARNING): New variable.
+ (AM_CFLAGS): Use NO_PACKED_NOT_ALIGNED_WARNING.
+ (AM_CXXFLAGS): Likewise.
+
+2021-02-17 Timm Bäder <tbaeder@redhat.com>
+
* eu.am (TRAMPOLINES_WARNING): New variable.
(AM_CFLAGS): Use TRAMPOLINES_WARNING.
(AM_CXXFLAGS): Likewise.
TRAMPOLINES_WARNING=
endif
+if HAVE_NO_PACKED_NOT_ALIGNED_WARNING
+NO_PACKED_NOT_ALIGNED_WARNING=-Wno-packed-not-aligned
+else
+NO_PACKED_NOT_ALIGNED_WARNING=
+endif
+
AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes $(TRAMPOLINES_WARNING) \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
- $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
+ $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
$($(*F)_CFLAGS)
AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
- $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
+ $(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
$($(*F)_CXXFLAGS)
COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
AM_CONDITIONAL(HAVE_TRAMPOLINES_WARNING,
[test "x$ac_cv_trampolines" != "xno"])
+AC_CACHE_CHECK([whether the compiler accepts -Wno-packed-not-aligned], ac_cv_no_packed_not_aligned, [dnl
+old_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -Wno-packed-not-aligned -Werror"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([])],
+ ac_cv_no_packed_not_aligned=yes, ac_cv_no_packed_not_aligned=no)
+CFLAGS="$old_CFLAGS"])
+AM_CONDITIONAL(HAVE_NO_PACKED_NOT_ALIGNED_WARNING,
+ [test "x$ac_cv_no_packed_not_aligned" != "xno"])
+
saved_LIBS="$LIBS"
AC_SEARCH_LIBS([argp_parse], [argp])
LIBS="$saved_LIBS"