1.0 KiB
§367 — RECONCILING A DECL CONFLICT BETWEEN TWO DRAFTS FOR THE SAME TU (P31 S68; main)
main/func_800242D0 declared extern u16 D_80063870; the just-banked main/func_800241C0 declares
extern s16 D_80063870[] at file scope. gcc-2.7.2 rejects the conflicting redeclaration at file
scope AND at block scope — the block-scope shadow was tried and also rejected. (That lever DOES
work for a conflicting typedef, cf. resident/func_800D06E8's Struct80078E78; it does not extend
to objects.)
The fix that banks: match the ALREADY-BANKED spelling and adapt the USE SITE — here
t4 = D_80063870; (array decay) instead of t4 = &D_80063870;. Safe because only the ADDRESS is
consumed (t4 is a register s16 *), so the decl's element type never reaches codegen — and the
whole-binary SHA proves it. Order matters for a chunked gate: the first draft to bank fixes the
file-scope spelling for every later one, so a two-draft conflict is not symmetric. --chunk 1 makes
this visible one draft at a time instead of sinking the pair.