From 3c1c98a43413e429459ca7d3615659f8149534b8 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Fri, 13 Aug 2021 14:52:03 +0900 Subject: core: Use flexible array member if compiler has support. * configure.ac (AC_C_FLEXIBLE_ARRAY_MEMBER): Add. * src/engine-gpg.c (struct arg_and_data_s): Use FLEXIBLE_ARRAY_MEMBER. (_add_arg): Use offsetof instead of sizeof. (add_data): Likewise. -- Before this fix, GCC 11 warns (with its bound checking feature). Signed-off-by: NIIBE Yutaka --- configure.ac | 1 + 1 file changed, 1 insertion(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 6cefc090..296553e3 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_HEADERS_ONCE([locale.h sys/select.h sys/uio.h argp.h stdint.h # Type checks. AC_C_INLINE +AC_C_FLEXIBLE_ARRAY_MEMBER AC_CHECK_SIZEOF(unsigned int) AC_SYS_LARGEFILE AC_TYPE_OFF_T -- cgit v1.2.3