Files
BFM-decomp/cookbook/C0293.md
T

1.3 KiB

§272 — The (void)-decl + empty-call wall: K&R the DEFINITION, not just the decls (P31 S59)

A family member's TU (and engine_core.h, inside DEFINE_ macros the TU instantiates — 42 of them for func_80162CCC, at the infamous engine_core.h:57282) declares the member extern void f(void); because every banked caller calls it K&R-style with no args. The draft's ANSI definition void f(u8 *a0) then fails TWICE, in sequence:

  1. conflicting types for 'f' against the (void) decls — the gate's arity pre-pass (fix_arity_callers --any-proto) fixes exactly this, and DID fire in every 0-bank pass;
  2. …after which the TU's own EMPTY CALL SITES f() die against the ANSI definition's prototype: too few arguments to function 'f'. This is the layer nothing addressed.

Law: when the destination TU calls the member with fewer args than its true definition takes, the definition must be K&R (void f(a0) u8 *a0; {…} — §99's zero-blast-radius lever): a K&R definition establishes no prototype, so the sloppy calls stay legal. Promotion-safe params only (pointers/int-width; a K&R narrow param compiles differently, §43/§102). Byte-proof: func_80162CCC rtu-FAILED as ANSI at both layers, rtu-MATCHed (23 ins) as K&R + pre-pass, then banked at the whole-binary gate. aprop_autodraft.kr_definition now emits every eligible draft K&R.