Skip to content

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

@rampageservices

Description

@rampageservices

Problem

Building gerbv with GCC 15 on Linux fails with:

thirdparty/tinyscheme/scheme.c: In function 'Cisalpha':
thirdparty/tinyscheme/scheme.c:269:44: error: implicit declaration of function 'isascii' [-Wimplicit-function-declaration]
  269 | static INLINE int Cisalpha(int c) { return isascii(c) && isalpha(c); }
      |                                            ^~~~~~~

isascii is a POSIX function, not part of the C standard. The project sets CMAKE_C_STANDARD 23 with CMAKE_C_EXTENSIONS OFF, so GCC compiles with -std=c23 which doesn't expose POSIX extensions. In C23, implicit function declarations are a hard error.

Root cause

The compilation-flags INTERFACE target defines _GNU_SOURCE on Linux (which exposes isascii from <ctype.h>), but tinyscheme_bundled links only config — it never gets _GNU_SOURCE.

Fix

Define _GNU_SOURCE on the tinyscheme_bundled target for Linux, matching the existing pattern in compilation-flags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions