From: Niels Möller Date: Fri, 6 Oct 2023 08:25:45 +0000 (+0200) Subject: ci: Fix testing of c89 build. X-Git-Tag: nettle_3.10rc1~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c0511b1ca400bec74e22d2f952588abf168a1ec5;p=thirdparty%2Fnettle.git ci: Fix testing of c89 build. --- diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 94b254f2..75fa9598 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -57,12 +57,11 @@ native/mini-gmp: variables: EXTRA_CONFIGURE_ARGS: '--enable-mini-gmp' -# FIXME: Need to defeat autoconf that automagically adds -std=gnu11. native/c89: extends: .native-build variables: EXTRA_CONFIGURE_ARGS: '--disable-assembler' - CC: 'gcc -std=c89' + CC: '$CI_PROJECT_DIR/misc/c89' native/ndebug: extends: .native-build diff --git a/ChangeLog b/ChangeLog index 69ec07dc..136fc78f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2023-10-06 Niels Möller + + * misc/c89: New wrapper script to force compiling in c89 mode. + 2023-10-04 Niels Möller * bswap-internal.h (bswap32_if_be, bswap32_if_le): New macros. diff --git a/misc/c89 b/misc/c89 new file mode 100755 index 00000000..0190ee88 --- /dev/null +++ b/misc/c89 @@ -0,0 +1,16 @@ +#! /bin/sh + +# GCC wrapper that passes -std=c89, and rejects all other -std flags + +for a in "$@" ; do + case "$a" in + -std=*) + echo "c89 wrapper: option $a rejected" >&2 + exit 1 + ;; + *) + ;; + esac +done + +gcc -std=c89 "$@"