Repository navigation
Claude/upgrade ape c library mm z gd - #611
Merged
Merged
Conversation
`mk -k install' on the VM: only `c99_complex.c' fails, predicted by name and by token (`syntax error, last name: _Float16'). It is the C99 `_Complex' runtime, built on gcc's extended floats, which bring libgcc's soft-float family with them; commented out of OFILES now the measurement is taken, since a C++ front end has no use for it. THE TWO `__thread' PREDICTIONS WERE WRONG AND THAT IS THE USEFUL HALF. `thread_dtor.c' and `dtor_list.c' compile: `cc/lex.c:1765' has carried `"__thread", LNAME, 0' and a swallow at `:1095' all along, under the comment "Plan 9 has no TLS; silently drop the qualifier." I checked EDG's constructs against C dialects from memory instead of against the compiler in this repository. An instrument whose keyword list is not the COMPILER's keyword list is measuring a different compiler -- the include-path lesson apdecl-sweep and apehdr-sweep each paid for, arriving one level down for a lexer. Asking `itab' plus the swallow list about the four float types afterwards is what says c99_complex.c really is the only failure. And that pass is not a clean bill: `__thread' dropped makes `__thread_needed_destruction_head' one process-wide global shared by every thread rather than one per thread, which is the stub-answering-the-wrong-thing shape. Harmless for cpfe, which is single-threaded; a live hazard for anything cpfe translates. Recorded, not fixed. The entry is removed from OFILES outright rather than commented out: a `#' line inside a continued list ends the assignment unless it ends in a backslash, which is the mkcont-sweep rule, and my first attempt put the backslash before the comment. mkcont-sweep: 0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
`mk -k install' in sys/src/ape/cmd/edg floods with cpp: src/class_decl.c:32786 #line specifies number out of range EDG's generated C carries a #line for nearly every statement, pointing back at the C++ it was translated from, and 113,411 of them are over 32768 -- 100,656 in src/sys_predef.c alone. It is a WARNING and nothing fails because of it, but the output is unreadable, which matters for the reason this tree already records: a harmless message that lands in a captured stream stops being harmless to the measurement. It would hide the compile result it is printed beside. NOTHING DOWNSTREAM IS 16-BIT, checked end to end rather than reasoned. `Source.line' in cpp.h is an int; `cc''s lineno is a long (cc.h:459); and every backend writes FOUR bytes -- 6c/swt.c:259-262 and 8c spell it `Bputc(b, p->lineno>>24)', while 5c, 7c, 9c, kc, qc, vc, 1c and 2c use the byte-array form `bf[6] = l>>24'. A grep for the first idiom alone reports six backends as unchecked and is wrong about all six: the name differs, the width does not. 6l/obj.c:871 reads the same four bytes back. So 32768 is inherited from an older object format and bounds nothing that exists. Raised to INT_MAX. The `<0' arm is kept and is the half that still does work: this file is built by native 6c, where long and int are both 32 bits, so a #line beyond that range comes back from atol saturated or wrapped, and a wrapped one is negative. 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.