add check for C23 compatibility

Sun, 15 Dec 2024 15:23:29 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 15 Dec 2024 15:23:29 +0100
changeset 1017
b0098854071f
parent 1016
fe177d6dabb8
child 1018
c773da859bad
child 1024
8f99f6c28bd3

add check for C23 compatibility

resolves #479

check-all.sh file | annotate | diff | comparison | revisions
configure file | annotate | diff | comparison | revisions
make/configure.vm file | annotate | diff | comparison | revisions
--- a/check-all.sh	Sun Dec 15 15:22:45 2024 +0100
+++ b/check-all.sh	Sun Dec 15 15:23:29 2024 +0100
@@ -36,6 +36,10 @@
 printf "Check w/o szmul builtin (c++)... "
 perform_check_cxx
 
+printf "Check gcc C23 preview... "
+CC=gcc CFLAGS=-std=c23 ./configure --debug > /dev/null
+perform_check
+
 # clean build files and restore config
 make clean > /dev/null
 mv config.mk.bak config.mk
--- a/configure	Sun Dec 15 15:22:45 2024 +0100
+++ b/configure	Sun Dec 15 15:23:29 2024 +0100
@@ -106,9 +106,11 @@
   --mandir=DIR            man documentation [DATAROOTDIR/man]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
 
+Build Types:
+--debug                 add extra compile flags for debug builds
+--release               add extra compile flags for release builds
+
 Options:
-  --debug                 add extra compile flags for debug builds
-  --release               add extra compile flags for release builds
   --with-docs=(all|html|api|none)
 
 Optional Features:
@@ -185,10 +187,11 @@
         "--infodir="*)        infodir=${ARG#--infodir=} ;;
         "--mandir"*)          mandir=${ARG#--mandir} ;;
         "--localedir"*)       localedir=${ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
         "--with-docs="*) OPT_WITH_DOCS=${ARG#--with-docs=} ;;
+        "--with-docs")  echo "option '$ARG' needs a value:"; echo "  $ARG=(all|html|api|none)"; abort_configure ;;
         "--enable-coverage") FEATURE_COVERAGE=on ;;
         "--disable-coverage") unset FEATURE_COVERAGE ;;
         "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;;
@@ -505,9 +508,9 @@
 DEPENDENCIES_FAILED=
 ERROR=0
 # unnamed dependencies
-TEMP_CFLAGS=
-TEMP_CXXFLAGS=
-TEMP_LDFLAGS=
+TEMP_CFLAGS="$CFLAGS"
+TEMP_CXXFLAGS="$CXXFLAGS"
+TEMP_LDFLAGS="$LDFLAGS"
 while true
 do
     while true
@@ -776,6 +779,11 @@
             ERROR=1
             DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED"
         fi
+    else
+        echo
+        echo "Invalid option value - usage:"
+        echo "  --with-docs=(all|html|api|none)"
+        abort_configure
     fi
 fi
 
--- a/make/configure.vm	Sun Dec 15 15:22:45 2024 +0100
+++ b/make/configure.vm	Sun Dec 15 15:23:29 2024 +0100
@@ -107,22 +107,24 @@
   --mandir=DIR            man documentation [DATAROOTDIR/man]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
 
+Build Types:
+--debug                 add extra compile flags for debug builds
+--release               add extra compile flags for release builds
 #if( $options.size() > 0 )
+
 Options:
-  --debug                 add extra compile flags for debug builds
-  --release               add extra compile flags for release builds
 #foreach( $opt in $options )
   --${opt.argument}=${opt.valuesString}
 #end
-
 #end
 #if( $features.size() > 0 )
+
 Optional Features:
 #foreach( $feature in $features )
 ${feature.helpText}
 #end
+#end
 
-#end
 __EOF__
 }
 
@@ -207,11 +209,12 @@
         "--infodir="*)        infodir=${D}{ARG#--infodir=} ;;
         "--mandir"*)          mandir=${D}{ARG#--mandir} ;;
         "--localedir"*)       localedir=${D}{ARG#--localedir} ;;
-        "--help"*) printhelp; abort_configure ;;
-        "--debug")           BUILD_TYPE="debug" ;;
-        "--release")         BUILD_TYPE="release" ;;
+        "--help"*)            printhelp; abort_configure ;;
+        "--debug")            BUILD_TYPE="debug" ;;
+        "--release")          BUILD_TYPE="release" ;;
     #foreach( $opt in $options )
         "--${opt.argument}="*) ${opt.varName}=${D}{ARG#--${opt.argument}=} ;;
+        "--${opt.argument}")  echo "option '$ARG' needs a value:"; echo "  $ARG=${opt.valuesString}"; abort_configure ;;
     #end
     #foreach( $feature in $features )
         "--enable-${feature.arg}") ${feature.varName}=on ;;
@@ -408,9 +411,9 @@
 ERROR=0
 #if( $dependencies.size() > 0 )
 # unnamed dependencies
-TEMP_CFLAGS=
-TEMP_CXXFLAGS=
-TEMP_LDFLAGS=
+TEMP_CFLAGS="$CFLAGS"
+TEMP_CXXFLAGS="$CXXFLAGS"
+TEMP_LDFLAGS="$LDFLAGS"
 #foreach( $dependency in $dependencies )
 while true
 do
@@ -643,6 +646,11 @@
             DEPENDENCIES_FAILED="option '${opt.argument}' $DEPENDENCIES_FAILED"
         fi
     #end
+    else
+        echo
+        echo "Invalid option value - usage:"
+        echo "  --${opt.argument}=${opt.valuesString}"
+        abort_configure
     fi
 fi
 #end

mercurial