diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2019-10-02 10:17:24 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2019-10-04 13:13:24 +0300 |
commit | 8d6733aad3e23cbb3813ee7161edb7ae7f9402df (patch) | |
tree | 9f9bff3da7b866060cd6bcb171d5fd41ee9f3df2 /configure.ac | |
parent | df4b6d7826fdc942c9709489acea9c2a9ab033f2 (diff) |
configure: suppress pointer to packed structure warnings
Fix GCC-9 build by handling "pointer to packed member of
a struct" warnings not as errors. These warnings are generated
e.g. when taking pointers to protocol header structures, which
are defined with packed attribute. These structures are
naturally aligned, so these warnings can be ignored.
chksum.c: In function odph_process_l4_hdr:
chksum.c:133:43: error: taking address of packed member of
struct <anonymous> may result in an unaligned pointer
value [-Werror=address-of-packed-member]
pkt_chksum_ptr = (uint16_t *)(void *)&udp_hdr_ptr->chksum;
^~~~~~~~~~~~~~~~~~~~
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 857905c3d..69474878d 100644 --- a/configure.ac +++ b/configure.ac @@ -112,6 +112,7 @@ AC_TYPE_UINT64_T ODP_CFLAGS="$ODP_CFLAGS -W -Wall -Werror" ODP_CXXFLAGS="$ODP_CXXFLAGS -W -Wall -Werror" +# Additional warnings: ODP_CHECK_CFLAG([-Wstrict-prototypes]) ODP_CHECK_CFLAG([-Wmissing-prototypes]) ODP_CHECK_CFLAG([-Wmissing-declarations]) @@ -127,6 +128,11 @@ ODP_CHECK_CFLAG([-Wwrite-strings]) ODP_CHECK_CFLAG([-Wformat-truncation=0]) ODP_CHECK_CFLAG([-Wformat-overflow=0]) +# Suppressed warnings: +# GCC-9 warns about taking pointers to packed structure fields (e.g. protocol +# header structures). Generate only warnings on those, not errors. +ODP_CHECK_CFLAG([-Wno-error=address-of-packed-member]) + ODP_CFLAGS="$ODP_CFLAGS -std=c99" ODP_CXXFLAGS="$ODP_CXXFLAGS -std=c++11" |