Skip to content

Commit bc5c9ed

Browse files
committed
gh-131093: Enforce -std=c11 for gcc at configure time rather than make time
When compiling under gcc, configure.ac currently assumes -std=c11 rather than checking it. This causes configure to succeed but make to fail on old compilers. Fix this by adding a check for -std=c11 in configure.ac.
1 parent 27ed645 commit bc5c9ed

File tree

4 files changed

+54
-2
lines changed

4 files changed

+54
-2
lines changed

Misc/ACKS

+1
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,7 @@ Cliff Wells
20322032
Rickard Westman
20332033
Joseph Weston
20342034
Jeff Wheeler
2035+
Chris White
20352036
Christopher White
20362037
David White
20372038
Mats Wichmann
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
On GCC-compatible compilers, check at configure time that ``-std=c11``
2+
works. This way you don't hit an "invalid option" error at make time on old
3+
compilers.

configure

+45-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

+5-1
Original file line numberDiff line numberDiff line change
@@ -2456,7 +2456,11 @@ then
24562456
fi
24572457

24582458
AS_VAR_IF([ac_cv_gcc_compat], [yes], [
2459-
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
2459+
AX_CHECK_COMPILE_FLAG([-std=c11],[
2460+
AS_VAR_APPEND([CFLAGS_NODIST], [" -std=c11"])
2461+
], [
2462+
AC_MSG_ERROR([Python requires -std=c11 on gcc])
2463+
], [-Werror])
24602464
24612465
PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
24622466
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],

0 commit comments

Comments
 (0)