Skip to content

libnet.h: revert the reject declaration -- flex has `extern int reject' - #606

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 build after the header round stopped in flex:

flexdef.h:366 external redeclaration of: reject
EXTERN INT reject
EXTERN FUNC(INT, IND CHAR, IND CHAR) INT libnet.h:36

flex declares reject as a VARIABLE. libnet.h is reached from <sys/socket.h>, so anything it declares is surface for every networked program in the tree, and 210 files under external/ use the name -- gnulib spells two parameters with it.

My sweep looked for `reject(' and so could not match a variable, which is the mistake CLAUDE.md already records from the bacon link round: four VARIABLES a function-shaped grep could not match (optind, opterr, optarg, stdin). Same error, same session. The rule is now in the build-system section: before adding any name to a public APE header, grep external/ for the bare word.

The net_accept/net_listen/net_reject removal STAYS -- those three were declared and defined nowhere, and nothing in this failure bears on them. Only the reject addition is reverted; reject stays defined and undeclared, as it was, with the reason in the header.

Control: a TU with #include <sys/socket.h>' and extern int reject;' gives 0 errors against the fixed header and `redeclared as different kind of symbol' with the declaration put back -- gcc's wording for what 6c printed. apehdr-sweep 148 headers, 0 standalone findings, together-case still 8; apdecl-sweep 0.

apehdr-sweep could not have caught this and the limit is recorded: it compiles APE headers against each other, while the collision came from a package's own header.

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

The first build after the header round stopped in flex:

  flexdef.h:366 external redeclaration of: reject
      EXTERN INT reject
      EXTERN FUNC(INT, IND CHAR, IND CHAR) INT   libnet.h:36

flex declares reject as a VARIABLE. libnet.h is reached from
<sys/socket.h>, so anything it declares is surface for every
networked program in the tree, and 210 files under external/ use the
name -- gnulib spells two parameters with it.

My sweep looked for `reject(' and so could not match a variable,
which is the mistake CLAUDE.md already records from the bacon link
round: four VARIABLES a function-shaped grep could not match
(optind, opterr, optarg, stdin). Same error, same session. The rule
is now in the build-system section: before adding any name to a
public APE header, grep external/ for the bare word.

The net_accept/net_listen/net_reject removal STAYS -- those three
were declared and defined nowhere, and nothing in this failure bears
on them. Only the reject addition is reverted; reject stays defined
and undeclared, as it was, with the reason in the header.

Control: a TU with `#include <sys/socket.h>' and `extern int reject;'
gives 0 errors against the fixed header and `redeclared as different
kind of symbol' with the declaration put back -- gcc's wording for
what 6c printed. apehdr-sweep 148 headers, 0 standalone findings,
together-case still 8; apdecl-sweep 0.

apehdr-sweep could not have caught this and the limit is recorded: it
compiles APE headers against each other, while the collision came
from a package's own header.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit db821d7 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