build: pin K&R-compatible C standard (gnu99) for modern Autoconf/clang#25
Merged
Conversation
Berkeley DB is K&R C: function definitions name parameters in a list after the parenthesis with the prototype supplied via __P(). C23 (gnu23) removed old-style definitions, and Autoconf >= 2.72 AC_PROG_CC probes -std=gnu23 first and adopts it, turning every definition in the tree into a hard error on a modern toolchain. Pre-seed the C11/C23 feature-test cache to "no", strip any -std=gnu23/c23 Autoconf splices into CC, and pin -std=gnu99 in CFLAGS. Silence the two inherent K&R diagnostics (-Wno-deprecated-non-prototype, -Wno-knr-promoted-parameter) behind compiler-support probes; keep all other warnings. configure regenerated with Autoconf 2.73. (Same fix as on perf/aio-stage2; should be consolidated into one master PR.)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pin a K&R-compatible C standard so the tree builds on modern toolchains
Berkeley DB is written in K&R (old-style) C: function definitions name their
parameters in a list following the parenthesis, with the prototype supplied
separately via the
__P()macro.C23 (
gnu23) removed old-style definitions from the language. AutoconfFix
nosoAC_PROG_CCadds no-stdflag, and strip any-std=gnu23/-std=c23Autoconf still splices into$CC.-std=gnu99inCFLAGS(keeps K&R definitions legal and the GNUextensions the tree uses).
(
-Wno-deprecated-non-prototype,-Wno-knr-promoted-parameter) behindcompiler-support probes, so unknown-flag compilers are unaffected. All other
warnings are kept.
configureregenerated with Autoconf 2.73 (the dev-flake toolchain).Why standalone
This is a prerequisite for any branch to build on a current toolchain. It is
currently duplicated on
perf/aio-stage2(#24) andperf/cursor-shard;landing it on master first lets those rebase onto it instead of carrying
conflicting copies of the regenerated
configure.Verified
Clean build on macOS (Apple clang 21) and via the Nix dev shell (gcc 14):
zero errors, zero source warnings.