Say you have a struct: aStruct STRUCT A DW 0 B DW 0 C DW 0 ENDS And then you declare an instance of it like such: MyStruct aStruct {1, 2} Note the struct is defined for 3 elements, but I only gave it two. What would you expect the compiler to do? I'd expect an error, since I did not define 3 elements, nor instruct the default value to be given like so: MyStruct aStruct {1, 2, } Instead, ML simply uses the default value. No errors, no warnings. So, YOU be warned. (If anyone knows how to force this to error, please leave me a post)
Posted on 2000-12-31 17:31:00 by Ernie
i have noticed that before aswell, i always have found the easist way to get around it, is before you compile your code add an extra member on the the end of the declaration. e.g. aStruct STRUCT A DW 0 B DW 0 C DW 0 ENDS MyStruct aStruct <1,2,3,0> or MyStruct aStruct <1,2,,0> just whatever, so when masm does compile, it gives you an error saying there are too many declarations. After that, just delete the extra data and recompile, if it all goes well then your structure has the correct number of members
Posted on 2001-01-01 17:20:00 by 870621345