Repository navigation
Conversation
pyconfig.h defines _POSIX_C_SOURCE 200809L and _XOPEN_SOURCE 700 unconditionally. A glibc with the POSIX.1-2024 feature macros sets 202405L / 800 first, so a file that includes libc headers before Python.h fails under -Werror when the Python headers are not on a system include path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015ZahKj3kRaL9bQVSUQSHjK
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
Fixes #152: the runtime core fails to build with
"_POSIX_C_SOURCE" redefined/"_XOPEN_SOURCE" redefinederrors frompyconfig.h.Two things combine:
features.hset_POSIX_C_SOURCE 202405Land, with_GNU_SOURCE,_XOPEN_SOURCE 800.pyconfig.hdefines them unconditionally as200809Land700(Python 3.10 and 3.13 alike), so any file that includes a libc header beforePython.hredefines them with a different value.-Werrorthe warning stops the build.python_plugin_bridge.hreachesPython.hafter libc headers inplc_boot.c,plc_retain.cpp,plc_state_manager.cppandunix_socket.c. The fix#undefs the two macros right before#include <Python.h>there. libc has already consumed them infeatures.h(include-guarded), so nothing it declares changes. The existing#pragma GCC diagnostic ignored "-Wcpp"does not cover macro redefinition in GCC; it is left as is.plugin_driver.candplc_main.cincludePython.hfirst and are not affected.Ticket
External contribution, no RTOP ticket. Closes #152.
How it was tested
/usr/include(via apython3-embed.pconPKG_CONFIG_PATH) and shadowingfeatures.hwith the POSIX.1-2024 values (202405L/800). Before the change,makefails inplc_boot.c,plc_retain.cpp,plc_state_manager.cppandunix_socket.cwith the errors from the issue; after it,plc_mainbuilds.tests/host/run.sh: all passed.clang-format --style=filereports no changes for the edited header.configure.acdefines the same200809L/700.Checklist
bash scripts/run-pytest.shpasses: not run; the change is a C header include-order fix with no Python-side effect.pre-commit runclean: clang-format clean for the edited.h..claude/review-guidelines.md): no IPC, scan-cycle or plugin ABI change.Contributor License Agreement
🤖 Generated with Claude Code
https://claude.ai/code/session_015ZahKj3kRaL9bQVSUQSHjK