Repository navigation
Claude/upgrade ape c library mm z gd - #601
Merged
Merged
Conversation
gmake would not link: "_convM2D: multiple initialization" on DATA records for switches<17>, GNU make's static array of struct command_switch. In sualign()'s TSTRUCT loop, o carries the offset of the current bit-field unit across iterations: the first field of a group sets it and every later field reads it back. The max-member-alignment loop added for -J wrote its own result into o as well, so the second and later fields of each group were placed at the previous member's alignment instead of the unit's offset. Here that put toenv, no_makefile and specified at offset 4, on top of the enum member, and 6l refused every array entry whose two writes to those four bytes were both non-zero. The line is not gated on conformalign, so plain builds were affected too; this has been wrong since 81a59a1. A separate variable now, in both the TSTRUCT and TUNION arms. structalign-test gains section 8 with that shape. Section 4's struct bits could not have caught it: its bit fields are the first members, so the clobbered value was the alignment of nothing. offsetof cannot name a bit field, so the section asserts the collision instead -- set each field of the group and ask whether the earlier member survived. 0 failures on gcc. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
The code for this landed in 6c51444 by a careless "git add -A"; that commit's message describes only the sualign fix. Recording it here rather than rewriting pushed history. <signal.h> declared signal() and sa_handler with empty parameter lists so that libap's three-argument Plan 9 dispatch -- handler(int, char *msg, Ureg *u) -- stayed reachable. That turned off argument checking for every caller in the tree, and the header did not match libap either: signal/signal.c defined signal() with the three-argument type. Both are void (*)(int) now, with SIG_DFL, SIG_ERR and SIG_IGN moving with them. _sighdlr[] holds the POSIX type and the cast to the extended form sits at the one place that calls a handler, _notetramp, so _envsetup.c and sigwait.c need none. The eleven arch notetramp.c are untouched. sigaction.c loses four casts that existed only because nothing had a type to agree with. Nothing in the tree uses the extension: of 56 handler names reaching signal(), two take more than one argument and neither is this form. Baseline measured on the host: signal.c, sigaction.c, sigwait.c and _envsetup.c give 1 error before and 1 after, the same pre-existing one -- lib.h declares _notehandler(void *) to match _NOTIFY while signal.c defines it (Ureg *). Recorded, not fixed: narrowing the declaration moves the mismatch to the _NOTIFY call. apehdr-sweep: 149 headers, 0 findings; together-case unchanged at 12. 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.