Skip to content

fix: drop _XOPEN_SOURCE from pty.c to keep the BSD tty API visible - #4

Merged
levtcode merged 2 commits into
mainfrom
small-fix/xopen
Aug 20, 2026
Merged

fix: drop _XOPEN_SOURCE from pty.c to keep the BSD tty API visible#4
levtcode merged 2 commits into
mainfrom
small-fix/xopen

Conversation

@cachel2

@cachel2 cachel2 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

CMake ya se compila con gnu11 (CMAKE_C_EXTENSIONS activado), por lo que posix_openpt es visible sin necesidad de _XOPEN_SOURCE. Definirlo oculta las extensiones BSD que necesita la ruta tty (cfmakeraw, TIOCSCTTY, struct winsize) y provoca un error en la compilación para macOS en cuanto se incorpora el código tty.

Además, en sandbox_darwin.c se indica que sandbox_init() está obsoleta desde macOS 10.8 y activa -Werror: envuelve esa única llamada en un pragma de clang con ámbito específico en lugar de desactivar OMICRON_WERROR.

@levtcode toco uno de tus archivos asi q es importante q los revises.

cachel2 and others added 2 commits August 18, 2026 21:15
CMake already builds with gnu11 (CMAKE_C_EXTENSIONS ON), so posix_openpt is visible without _XOPEN_SOURCE. Defining it hides the BSD extensions the tty path needs (cfmakeraw, TIOCSCTTY, struct winsize) and breaks the macOS build as soon as the tty code lands.

Also documents in sandbox_darwin.c that sandbox_init() is deprecated since macOS 10.8 and trips -Werror: wrap that single call in a scoped clang pragma instead of turning OMICRON_WERROR off.
@levtcode

Copy link
Copy Markdown
Owner

Ahora el CI funciona para los 2 sistemas

@levtcode
levtcode merged commit 3cfcba7 into main Aug 20, 2026
2 checks passed
@levtcode
levtcode deleted the small-fix/xopen branch August 20, 2026 13:09
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