Skip to content

fix: define _GNU_SOURCE for tinyscheme on Linux#371

Closed
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:fix/tinyscheme-isascii-c23
Closed

fix: define _GNU_SOURCE for tinyscheme on Linux#371
rampageservices wants to merge 1 commit intogerbv:developfrom
SourceParts:fix/tinyscheme-isascii-c23

Conversation

@rampageservices
Copy link
Copy Markdown
Contributor

Summary

Building with GCC 15 on Linux fails because tinyscheme_bundled calls isascii(), a POSIX function not exposed under -std=c23 (no extensions). GCC 15 treats implicit function declarations as a hard error in C23.

The compilation-flags INTERFACE target already defines _GNU_SOURCE on Linux, but tinyscheme_bundled links only config and never receives it. This adds the definition directly to the tinyscheme target.

Fixes #370

Test plan

  • cmake --build with GCC 15 on Linux — tinyscheme compiles without -D_GNU_SOURCE workaround
  • Verify no regression on GCC 14 or Clang

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
@rampageservices
Copy link
Copy Markdown
Contributor Author

Closing in favor of #374 — the _GNU_SOURCE fix for tinyscheme should go in the new thirdparty/tinyscheme/CMakeLists.txt that #374 introduces. Noted on that PR.

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

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tinyscheme fails to compile with GCC 15 / C23: isascii undeclared

2 participants