Skip to content

configure.ac: fix -Wno-deprecated-enum-enum-conversion probe under ccache#10897

Open
julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:julek-dev/configure-deprecated-enum-probe-ccache
Open

configure.ac: fix -Wno-deprecated-enum-enum-conversion probe under ccache#10897
julek-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
julek-wolfssl:julek-dev/configure-deprecated-enum-probe-ccache

Conversation

@julek-wolfssl

Copy link
Copy Markdown
Member

Summary

  • gcc only promotes -Wno-deprecated-enum-enum-conversion (a C++/ObjC++-only option) to an error when -Werror is processed before the -Wno- option. ccache splits the command line into preprocessor and compiler-only options and re-appends -Werror after the -Wno- option, so with CC="ccache gcc" the AX_CHECK_COMPILE_FLAG probe exits 0 and configure adds the C++-only option to AM_CFLAGS, causing gcc to emit the cc1 warning on every C compilation unit (e.g. in the multi-arch workflow).
  • Gate the probe on ac_c_werror_flag instead: AC_COMPILE_IFELSE then fails on any stderr output, independent of option order. gcc (with or without ccache) now rejects the flag; clang still accepts it silently and keeps it.

Test plan

  • ./configure CC="ccache gcc" no longer adds -Wno-deprecated-enum-enum-conversion to AM_CFLAGS
  • CI passes

Copilot AI review requested due to automatic review settings July 14, 2026 09:43
@julek-wolfssl julek-wolfssl self-assigned this Jul 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts an Autoconf compile-flag probe in configure.ac so that -Wno-deprecated-enum-enum-conversion (a C++/ObjC++-only warning option) is not incorrectly detected as usable for C builds when CC="ccache gcc" reorders -Werror during AX_CHECK_COMPILE_FLAG checks.

Changes:

  • Switch the probe from explicitly passing -Werror in the flag list to temporarily enabling ac_c_werror_flag for the duration of the check.
  • Restore the prior ac_c_werror_flag value after the probe to avoid impacting subsequent configure tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@julek-wolfssl

julek-wolfssl commented Jul 14, 2026

Copy link
Copy Markdown
Member Author

retest this please.

@julek-wolfssl julek-wolfssl marked this pull request as ready for review July 14, 2026 12:30
@github-actions

Copy link
Copy Markdown

retest this please

…ache

gcc only promotes "command-line option '-Wno-deprecated-enum-enum-conversion'
is valid for C++/ObjC++ but not for C" to an error when -Werror is processed
before the -Wno- option. ccache splits the command line into preprocessor and
compiler-only options and re-appends -Werror after the -Wno- option, so with
CC="ccache gcc" the AX_CHECK_COMPILE_FLAG([-Werror -Wno-...]) probe exits 0.
configure then adds the C++-only option to AM_CFLAGS and gcc emits the cc1
warning on every C compilation unit, e.g. in the multi-arch workflow.

Gate the probe on ac_c_werror_flag instead: AC_COMPILE_IFELSE then fails on
any stderr output, independent of option order. gcc (with or without ccache)
now rejects the flag; clang still accepts it silently and keeps it.
@julek-wolfssl julek-wolfssl force-pushed the julek-dev/configure-deprecated-enum-probe-ccache branch from 5a8dba9 to b3356b5 Compare July 16, 2026 12:09
@julek-wolfssl

Copy link
Copy Markdown
Member Author

retest this please

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants