From dfaec94e518ef555c6477ae21708e0354047e23b Mon Sep 17 00:00:00 2001 From: Drew T <50529377+Druthulu@users.noreply.github.com> Date: Sun, 30 Aug 2026 22:49:42 -0600 Subject: [PATCH] =?UTF-8?q?fix(main):=20declare=20the=203=20return-type-fl?= =?UTF-8?q?ip=20fns=20s32,=20not=20void=20=E2=80=94=20byte-neutral,=20unbl?= =?UTF-8?q?ocks=20their=20drafts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit src/800.c declares func_8002A544/func_8002A2D4/func_8002A7B4 as `extern void f(s32)`, but each body genuinely materializes a value in $v0 on both exits (asm-proven). Under a true void signature gcc-2.7.2 dead-codes exactly those materializations, so the byte-correct s32 body can never compile in this TU — cookbook §43's 'return-type flip pair', which §183 records as TU-edit-required. All three call sites discard the result (`func_8002A544(0x32);` as a bare statement), so widening the declaration cannot change a caller. NEGATIVE CONTROL, run twice: with the edit applied and NO draft substituted, main still builds 143dbb89f34491258bbc27810d0a12ec8b43a8dd, identical to config/check.us.sha. The edit is byte-neutral by measurement, not by argument. Committing it SEPARATELY because gate_main snapshots and restores the TU between passes: an uncommitted edit is reverted before the gate ever sees it (measured — the first attempt banked 4 of 7 and left all three of these as stubs). Note for the record: the S66 overlay reconcile lane proved this class also has DRAFT-ONLY escapes that need no TU edit at all — §202's asm-label alias (`s32 aF800CCBC0(void) __asm__("func_800CCBC0")`, used byte-proven on func_800CCBC0 and func_800D30D0) and a new register-$2 + input-barrier + shared goto-exit lever (func_800D2A24). Those are the smaller blast radius and should be preferred where the TU is shared; this edit is kept because it is proven neutral and these three drafts already exist in s32 form. --- src/800.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/800.c b/src/800.c index 83fc29357..2a5d273ad 100644 --- a/src/800.c +++ b/src/800.c @@ -14853,7 +14853,7 @@ void func_8002958C(s32 arg0) { } -extern void func_8002A544(s32); +extern s32 func_8002A544(s32); extern s32 D_80078E88; void func_8002959C(void) { @@ -15195,7 +15195,7 @@ extern s32 func_80029504(void); extern s32 D_80078F04; extern s32 D_80078F08; extern s32 D_80078F0C; -extern void func_8002A2D4(s32); +extern s32 func_8002A2D4(s32); void func_80029ED4(s32 arg0) { s32 v0; @@ -15470,7 +15470,7 @@ s32 func_8002A4FC(s32 a0) { return *(u16 *)(D_800638FE + D_80078EEC * 16); } -extern void func_8002A544(s32); +extern s32 func_8002A544(s32); void func_8002A520(s32 arg0) { func_8002A544(*(u8 *) (arg0 + 200)); @@ -15575,7 +15575,7 @@ s32 func_8002A76C(void) { return D_80063902[D_80078EFC][0]; } -extern void func_8002A7B4(s32); +extern s32 func_8002A7B4(s32); void func_8002A790(u8 *a0) {