z00m128 / sjasmplus

Command-line cross-compiler of assembly language for Z80 CPU.
http://z00m128.github.io/sjasmplus/
BSD 3-Clause "New" or "Revised" License
383 stars 54 forks source link

duplicate lables #220

Closed cardosojoao closed 1 year ago

cardosojoao commented 1 year ago
Version Platform Topic
v1.20.2 windows? directive

I have some defines that I use to enable the custom location of some tables, but when I enable both of them I get some duplicates messages image

duplicate messages image

I do have a test project that does the same and don't have any issues, but the project where I found the error is bigger around 12k lines and 188 files

ped7g commented 1 year ago

That's because the define SetE_SpritesHW is defined as empty string, and it exactly does match beginning of labels like SetE_SpritesHW_Map_Address, so it gets substituted by the sub-word matching.

To avoid it use define which does not match the part of labels, like

  DEFINE SET_E_SPRITES_HW
  IFDEF SET_E_SPRITES_HW
SetE_SpritesHW_Map_Address   equ $c180
...
  ENDIF