Skip to content

gh-96821: Check for -fstrict-overflow only if --with-strict-overflow is passed#139595

Open
StanFromIreland wants to merge 4 commits intopython:mainfrom
StanFromIreland:refactor-autoconf
Open

gh-96821: Check for -fstrict-overflow only if --with-strict-overflow is passed#139595
StanFromIreland wants to merge 4 commits intopython:mainfrom
StanFromIreland:refactor-autoconf

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Oct 5, 2025

@StanFromIreland
Copy link
Member Author

Friendly ping @erlend-aasland / @hauntsaninja :-)

configure.ac Outdated
Comment on lines +2238 to +2246
CFLAGS="-fstrict-overflow -fno-strict-overflow"
AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
[ac_cv_cc_supports_fstrict_overflow],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[ac_cv_cc_supports_fstrict_overflow=yes],
[ac_cv_cc_supports_fstrict_overflow=no]
)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be fine with using AX_CHECK_COMPILE_FLAG here. (I don't remember why I did not recommend that when we added this code.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you suggesting we just check -fstrict-overflow? Currently it checks both -fstrict-overflow and -fno-strict-overflow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Using AX_CHECK_COMPILE_FLAG makes it more complicated to follow IMO, but I pushed the change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants