Files
BFM-decomp/cookbook/C0359.md
T

1.4 KiB

§321 — FILE-SCOPE DUPLICATE ANONYMOUS-STRUCT TYPEDEFS ARE A HARD ERROR; THE SAME TEXT AT BLOCK SCOPE IS A WARNING (P31 S66; byte-proven func_80180728, func_8017F9F8, func_8017E07C)

THE TELL. conflicting types for 'D_xxxxxxxx' or a redefinition error naming a struct typedef, where your draft's declaration is TEXTUALLY IDENTICAL to one already in the TU. Two anonymous struct definitions are two DISTINCT types to gcc-2.7.2 even when spelled the same, so a file-scope duplicate is fatal.

THE DIALS, all three byte-proven in one lane:

  1. Move the duplicate to BLOCK scope. A block-scope redeclaration of the same extern symbol is only a warning here, and is codegen-neutral (func_80180728, MATCH; verified both standalone and spliced via rtu_match).
  2. Or hoist to file scope and delete the local copy — the mirror move, when the TU's own declaration already sits at file scope right before your INCLUDE_ASM slot (func_8017F9F8, MATCH 117 ins, valid against BOTH ov_SC01_005 and its ov_SC01_006 twin).
  3. Name a local typedef for its OWN address, never a neighbour's. SVEC_8017E158 belongs to func_8017E158; reusing that tag inside func_8017E07C's draft is a real two-anonymous-structs conflict once spliced. Use SVEC_<own addr> (func_8017E07C, MATCH).

Do not reach for a cast-at-use here — the shape already matches; the conflict is type IDENTITY, not type WIDTH.