From 77971fdf4116fadcbc597ee92acb36cc2b07ed16 Mon Sep 17 00:00:00 2001 From: zaikunzhang Date: Thu, 29 Jun 2023 08:01:23 +0800 Subject: [PATCH] 230629.080123.CST correct fortran Makefile --- fortran/tests/makefiles/Makefile.common | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fortran/tests/makefiles/Makefile.common b/fortran/tests/makefiles/Makefile.common index 6e5558ff59..92b01da1e1 100644 --- a/fortran/tests/makefiles/Makefile.common +++ b/fortran/tests/makefiles/Makefile.common @@ -411,9 +411,10 @@ ftest_i2_r16_d1_tst_c ftest_i4_r16_d1_tst_c ftest_i8_r16_d1_tst_c ftest_i2_r16_d # 1. In the debug mode, our code includes the BACKTRACE function if the compiler is gfortran. This # makes the code not standard-conforming. So -std=f$(FSTD) cannot be imposed without -fall-intrinsics. # 2. As of 2022, -Wextra implies -Wcompare-reals, -Wunused-parameter, and -Wdo-subscript. +# 3. For `$$((10#$(FS)))`, see https://stackoverflow.com/questions/24777597/value-too-great-for-base-error-token-is-08 #GFORT := gfortran -pg # Compile for profiling with the gprof profiler. Does not work with macOS on GitHub Actions due to missing gcrt1.o GFORT := gfortran -GFSTD := $(shell [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 8 ]] && ([[ $(FS) -lt 18 ]] && echo -std=f2018 || echo -std=f20$(FS)) || echo "") +GFSTD := $(shell [[ $$(($(GFORT) -dumpversion 2>/dev/null || echo 0) | sed 's|\..*||') -gt 8 ]] && ([[ $$((10#$(FS))) -lt 18 ]] && echo -std=f2018 || echo -std=f20$(FS)) || echo "") # 1. gfortran 7 raises a false positive warning regarding "maybe-uninitialized" of allocatable arrays. # See https://stackoverflow.com/questions/56261880/fortran-re-allocation-on-assignment-and-gfortran-warnings # 2. As of gfortran 11, gfortran raises a false positive warning regarding "maybe-uninitialized" of