Repository navigation
Claude/upgrade ape c library mm z gd - #610
Merged
Merged
Conversation
Asked all at once rather than one per round, which is the rule bacon's missing headers and bacon's missing link symbols both paid for. CONSTRUCTS. Swept over all 133 files with comments, string and character literals and `#line' stripped FIRST, and the stripping is the measurement rather than a tidying step: a raw grep reports `alignof' 2343 times, `typeof' 425, `static_assert' 1156 and `_Complex' 702, and every one of those is ZERO afterwards -- they were EDG's own diagnostic text and mangled names like `_ZN3edg27ec_wrong_entity_for_alignasE', the word inside a longer identifier, never a keyword. After stripping, every C11/C23 construct kencc lacks is zero except three files: lib_src/c99_complex.c _Float16, __bf16, __float80, __float128 lib_src/thread_dtor.c __thread lib_src/dtor_list.c __thread All three use a feature of the HOST compiler rather than anything of EDG's design, which is exactly why `gcc -fsyntax-only' reports 0 errors over them: the host compiler is the one that put them there. Left in OFILES deliberately -- with `mk -k' the other 48 build and the three failures confirm the sweep named the whole class, where removing them first would make a clean run say nothing. SIZE LIMITS asked rather than assumed, because a 315,616-line translation unit invites them, and none bites: longest line 430 bytes against cpp's INS 32768, longest identifier 295 against cc's NSYMB 1500, most `case' in a file 7204 where 6c's Case is a linked list. 6c's `NSYM 50' is NOT a cap: swt.c:229 wraps the slot to 1 and re-emits the ANAME, so it is a cache. SYMBOLS. All 133 compiled with gcc (133 of 133), then nm's defined set subtracted from nm's undefined set: 679 truly external, 558 of them `_Z'-prefixed and 121 plain C names. libap defines every plain name but two -- and the first sweep said two dozen were absent only because its regex required a character before the name, which a definition starting in column 0 does not have. That is the function-shaped grep of the `reject' round in a new spelling. _setjmp lib_src/eh_util.c, lib_src/newnothrow.c __cxa_finalize lib_src/static_init.c `_setjmp' is a missed line in kencc_targ.h, not a libap gap: EDG's TARG_SETJMP_FUNC defaults to "_setjmp" and win64 -- the same configuration every other value here came from -- says "setjmp". Set now, effective at the next translation. The buffer was checked rather than assumed: `long [25]' is 100 bytes under kencc's 4-byte long against jmp_buf's 80 and the 64 amd64 writes, and that is the half that would have been silent. Adding `_setjmp' to a public APE header is the wrong answer and the bare-word sweep says why -- lua/ldo.c:80 uses the name under LUA_USE_POSIX. `__cxa_finalize' is not a libap question: unconditional in EDG's own cxxabi.h, defined nowhere in lib_src, and upstream expects the platform's Itanium-ABI runtime. One small APExp-owned file in lib/edg if the link needs it. THE LINK MODEL IS TWO HALVES AND READING THEM AS ONE WAS WRONG. 556 of the 558 `_Z' names are template function instantiations, and ZERO are vtables, typeinfo, typeinfo names, guard variables or thunks -- so cpfe emitted them NOWHERE and the output is not self-contained for templates independently of --one_instantiation_per_object. The default output already depends on a prelink step, for exactly the entities OIPO was being considered for; the next translation needs an instantiation-mode flag. Separately the duplicate half is now measured from objects rather than annotations: 3124 symbols defined in more than one object and 6410 surplus definitions, against the 3094 counted from COMDAT annotations -- two routes to the same number. Two confirmations fell out of the same table and both say the staging really used this tree: `_errnoloc' is undefined in six of src/'s files and defined in libap's plan9/_envsetup.c, which is APE's `errno' macro expanded; `isNaN' -- Plan 9's own capitalisation -- is referenced by src/float_pt.c. Neither name exists on glibc. And nine of src/'s files carry `extern unsigned char _ctype[];' byte for byte as APE's <ctype.h> declares it, which also pins this generated C to the `_ctype' bit layout the _ISblank round changed. Recorded for util/, which has no mkfile and blocks nothing: edg_decode, edg_munch and edg_prelink each bundle their own `getopt', `optind', `optarg' and `opterr', so linking them against libap would give `redefinition: getopt' -- the f2c-supplies-its-own-malloc shape. Nothing in src/ or lib_src/ is affected. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
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.
No description provided.