News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Problem with nested structures' names

Started by Yuri, July 20, 2009, 04:31:19 PM

Previous topic - Next topic

Yuri

The problem arises if I use generic names for nested structures, for example, HDITEM rather than directly HDITEMA or HDITEMW. To illustrate this, I have composed a simple example:

SampleA STRUCT
  a DD
  b DD
ENDS

#ifndef UNICODE
#define Sample SampleA
#endif

MyStruct1 STRUCT
  c Sample
  d DD
  e DD
ENDS

MyStruct2 STRUCT
  c SampleA
  d DD
  e DD
ENDS

; ==============================================================================

DATA SECTION

example1 MyStruct1
example2 MyStruct2
buf DB 100 DUP 0

; ==============================================================================

CODE SECTION

Start:
invoke msvcrt.dll:sprintf, addr buf, <"example1 size: %d",13,10,"example2 size: %d",0>, \
                                       sizeof example1, sizeof example2
add esp,16
invoke user32.dll:MessageBoxA, 0, addr buf, "Test", 0
ret


Here's what it reports to me:
Quote
---------------------------
Test
---------------------------
example1 size: 8

example2 size: 16
---------------------------
ОК   
---------------------------

The sizes are different, though Sample was defined to be the same as SampleA.

jorgon

Hi Yuri

Thanks for paring down this bug making it easier to chase up.
I'm working on this and will come back to you.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

jorgon

Yuri

I've added this functionality in GoAsm Version 0.56.6e which can be obtained from this thread to which you have contributed.

Author of the "Go" tools (GoAsm, GoLink, GoRC, GoBug)

Yuri

Thank you for the quick help, Jeremy! Now everything is OK.  :)