fix: define _GNU_SOURCE for tinyscheme on Linux#371
Closed
rampageservices wants to merge 1 commit intogerbv:developfrom
Closed
fix: define _GNU_SOURCE for tinyscheme on Linux#371rampageservices wants to merge 1 commit intogerbv:developfrom
rampageservices wants to merge 1 commit intogerbv:developfrom
Conversation
tinyscheme uses isascii() in scheme.c, which is a POSIX function not part of the C standard. The project sets CMAKE_C_EXTENSIONS OFF, so GCC compiles with -std=c23 where implicit function declarations are a hard error. The compilation-flags INTERFACE target already defines _GNU_SOURCE on Linux, but tinyscheme_bundled links only config and never receives it. Add the definition directly to the tinyscheme target. Fixes gerbv#370
Contributor
Author
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.
Summary
Building with GCC 15 on Linux fails because
tinyscheme_bundledcallsisascii(), a POSIX function not exposed under-std=c23(no extensions). GCC 15 treats implicit function declarations as a hard error in C23.The
compilation-flagsINTERFACE target already defines_GNU_SOURCEon Linux, buttinyscheme_bundledlinks onlyconfigand never receives it. This adds the definition directly to the tinyscheme target.Fixes #370
Test plan
cmake --buildwith GCC 15 on Linux — tinyscheme compiles without-D_GNU_SOURCEworkaround