Skip to content

gh-131093: Enforce -std=c11 for gcc at configure time rather than make time #133608

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -2032,6 +2032,7 @@ Cliff Wells
Rickard Westman
Joseph Weston
Jeff Wheeler
Chris White
Christopher White
David White
Mats Wichmann
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
On GCC-compatible compilers, check at configure time that ``-std=c11``
works. This way you don't hit an "invalid option" error at make time on old
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
works. This way you don't hit an "invalid option" error at make time on old
works. This way you don't hit an "invalid option" error at build time on old

compilers.
46 changes: 45 additions & 1 deletion configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2456,7 +2456,11 @@ then
fi

AS_VAR_IF([ac_cv_gcc_compat], [yes], [
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
AX_CHECK_COMPILE_FLAG([-std=c11],[
AS_VAR_APPEND([CFLAGS_NODIST], [" -std=c11"])
], [
AC_MSG_ERROR([Python requires -std=c11 on gcc])
], [-Werror])

PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
Expand Down
Loading