From edfa2981326ea4a476d420436323d0fb37a4efab Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sat, 11 Aug 2018 15:06:29 +0200 Subject: projects.h: use param[] variable-length member syntax with GCC >= 8 to fix optimization issue with gcc 8.2 (fixes #1084) --- src/projects.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/projects.h b/src/projects.h index 928985f6..ee0e2b65 100644 --- a/src/projects.h +++ b/src/projects.h @@ -458,9 +458,10 @@ struct PJconsts { struct ARG_list { paralist *next; char used; -#ifdef __GNUC__ - char param[0]; /* variable-length member */ - /* Safer to use [0] for gcc. See https://github.com/OSGeo/proj.4/pull/1087 */ +#if defined(__GNUC__) && __GNUC__ >= 8 + char param[]; /* variable-length member */ + /* Safer to use [] for gcc 8. See https://github.com/OSGeo/proj.4/pull/1087 */ + /* and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86914 */ #else char param[1]; /* variable-length member */ #endif -- cgit v1.2.3