Skip to content

Commit

Permalink
-std=gnu17for gcc-15
Browse files Browse the repository at this point in the history
  • Loading branch information
edoapra committed Feb 20, 2025
1 parent 73c9c4a commit 8c853e3
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/tools/get-tools-github
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ if [[ -d "ga-5.9" ]]; then
if [[ ! -f "ga-5.9/patched59" ]]; then
./gasparse_patch.sh $GA_DIR
./eaf32bit_patch.sh $GA_DIR
patch -p0 -s -N < std17.patch
echo patched
touch ga-5.9/patched59
fi
Expand Down
68 changes: 68 additions & 0 deletions src/tools/std17.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
--- ga-5.9/configure 2025-01-31 12:23:55.000000000 -0800
+++ ga-5.9/configure 2025-02-19 19:12:20.292944429 -0800
@@ -661,6 +661,7 @@
ac_header_c_list=
ac_c_werror_flag=
ac_c_werror_flag=
+ac_c_werror_flag=
ac_func_c_list=
ac_f77_werror_flag=
ac_f77_werror_flag=
@@ -802,6 +803,7 @@
GA_COPT
PLOTLIB
C_POINTER_AS_INTEGER
+CFLAG_STD_GNU17
CFLAG_NO_LOOP_VECT
CFLAG_NO_LOOP_OPT
HAVE_SYS_WEAK_ALIAS_PRAGMA_FALSE
@@ -14432,6 +14434,49 @@



+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -std=gnu17 support in C compiler" >&5
+printf %s "checking for -std=gnu17 support in C compiler... " >&6; }
+if test ${ga_cv_c_gnu_std_gnu17+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+
+ ga_cv_c_gnu_std_gnu17=
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$save_CFLAGS -std=gnu17"
+ save_ac_c_werror_flag="$ac_c_werror_flag"
+
+ac_c_werror_flag=yes
+ rm -f a.out
+ touch a.out
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ga_cv_c_gnu_std_gnu17=-std=gnu17
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+ CFLAGS="$save_CFLAGS"
+ ac_c_werror_flag="$save_ac_c_werror_flag"
+ rm -f a.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ga_cv_c_gnu_std_gnu17" >&5
+printf "%s\n" "$ga_cv_c_gnu_std_gnu17" >&6; }
+ CFLAG_STD_GNU17=$ga_cv_c_gnu_std_gnu17
+
+
+
# Checks for C type sizes.
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects

0 comments on commit 8c853e3

Please sign in to comment.