Skip to content

bash: gettext's lock.h was shadowing APE's - #599

Merged
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd
Oct 7, 2026
Merged

staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

The first rebuild after the -J default stopped with

/sys/include/ape/qlock.h:44 syntax error, last name: Lock

compiling general.c. -I$BASHSRC/lib/intl was on bash's CFLAGS and that directory holds gettext's own lock.h. An -I is searched ahead of the system path, so APE's <pthread.h>, reaching its own #include <lock.h>, got gettext's file, which never typedefs Lock; <qlock.h> then reached "Lock lock;" with no such type.

It was inert while <qlock.h> carried its own Lock typedef behind an always-true "#ifndef Lock". Removing that duplicate was correct and is what made the shadow reachable.

-J is not in frame: the error is a parse of a type name, and the same file fails the same way under -9.

Removing the -I is measured: ENABLE_NLS is undef, the only <libintl.h>
includes in the compiled set are behind #if ENABLE_NLS, and nothing compiled here names any other of that directory's 29 headers.

ishadow-sweep.py sweeps the class -- which package -I directories hold a header that an APE header includes with angle brackets. 31 pairs over 19 names, and it gates nothing: most are deliberate, so a hit is a question rather than a finding.

Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs

The first rebuild after the -J default stopped with

    /sys/include/ape/qlock.h:44 syntax error, last name: Lock

compiling general.c.  -I$BASHSRC/lib/intl was on bash's CFLAGS and
that directory holds gettext's own lock.h.  An -I is searched ahead of
the system path, so APE's <pthread.h>, reaching its own
#include <lock.h>, got gettext's file, which never typedefs Lock;
<qlock.h> then reached "Lock lock;" with no such type.

It was inert while <qlock.h> carried its own Lock typedef behind an
always-true "#ifndef Lock".  Removing that duplicate was correct and is
what made the shadow reachable.

-J is not in frame: the error is a parse of a type name, and the same
file fails the same way under -9.

Removing the -I is measured: ENABLE_NLS is undef, the only <libintl.h>
includes in the compiled set are behind #if ENABLE_NLS, and nothing
compiled here names any other of that directory's 29 headers.

ishadow-sweep.py sweeps the class -- which package -I directories hold
a header that an APE header includes with angle brackets.  31 pairs
over 19 names, and it gates nothing: most are deliberate, so a hit is
a question rather than a finding.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit c88f854 into main Oct 7, 2026
1 check passed
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