From 2d3e973d67e79f3d7518241e59f0894c6e33b453 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Thu, 2 Nov 2023 15:20:33 +1100 Subject: [PATCH] sun/oracle workshop c99: allow for trailing zero size arrays Encountered while testing -O1 with the workshop compiler on Oracle Linux, follows the same test and workaround done in hints/solaris_2.sh --- hints/linux.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hints/linux.sh b/hints/linux.sh index b3cd322dc805..a3e476e4f6a9 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -125,6 +125,15 @@ case "`${cc:-cc} -V 2>&1`" in d_attribute_pure='undef' d_attribute_unused='undef' d_attribute_warn_unused_result='undef' + case "$cc" in + *c99) # Without -Xa c99 errors on some Linux system headers + # in particular zero sized arrays at the end of structs + case "$ccflags" in + *-Xa*) ;; + *) ccflags="$ccflags -Xa" ;; + esac + ;; + esac ;; esac