The MASM Forum

Projects => Rarely Used Projects => GoAsm => Topic started by: Yuri on March 13, 2015, 03:41:56 PM

Title: Wrong result of SIZEOF for a nested structure
Post by: Yuri on March 13, 2015, 03:41:56 PM
The S1 structure shows different size depending on whether it's nested or not.

S1 STRUCT
    a DD
    b DD
ENDS

S2 STRUCT
    c S1
ENDS

CODE SECTION

Start:
    invoke msvcrt:printf, "sizeof S1 = %d  sizeof S2.c = %d", sizeof S1, sizeof S2.c
#if x86
    add esp,0Ch
#endif
    ret


Output:
Quote
sizeof S1 = 8  sizeof S2.c = 4
Title: Re: Wrong result of SIZEOF for a nested structure
Post by: wjr on April 03, 2015, 01:28:23 AM
Busy spell with other work, just as I was nearing completion of GoAsm v0.60, but I shall look into this one...