]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
ci: Fix testing of c89 build.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 6 Oct 2023 08:25:45 +0000 (10:25 +0200)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 6 Oct 2023 08:58:17 +0000 (10:58 +0200)
.gitlab-ci.yml
ChangeLog
misc/c89 [new file with mode: 0755]

index 94b254f297ce39f39ea1f280b30e9c2f7c8e8268..75fa95988b61df9f44607c6c71f99e834afa07b2 100644 (file)
@@ -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
index 69ec07dc1a34ffe78c073928466a3eded8032ea7..136fc78f2c2604071a55063bd7159bf8ac28dccc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2023-10-06  Niels Möller  <nisse@lysator.liu.se>
+
+       * misc/c89: New wrapper script to force compiling in c89 mode.
+
 2023-10-04  Niels Möller  <nisse@lysator.liu.se>
 
        * bswap-internal.h (bswap32_if_be, bswap32_if_le): New macros.
diff --git a/misc/c89 b/misc/c89
new file mode 100755 (executable)
index 0000000..0190ee8
--- /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 "$@"