In my spare free time Iím building a CAD system in ASM using MASM. Itís becoming a large app so I decide to use libraries to reduce the compilation time. Since a while Iím experimenting a strange effect, that when I replace the libs with the original code, MASM is refusing to compile giving me strange error messages like ďerror A2008: syntax error: typedef??? on lines where no typedef plays a role. If I reduce the project, the error disappears.

Any idea what is happening?


Posted on 2006-03-07 10:36:10 by Biterider
I'ver had similar problems recently which had an interesting cause.
I had been writing a quite lengthy Method of an OA32 Object, and it had a relatively large codeblock that needed to be repeated in it three times.
Naturally, I wrapped the first Instance of it inside Macro/EndM pair of statements, the immediately after the Endm I had a reference to the macro (thus implementing the macro I'd defined) - and replaced the other two instances of the codeblock with references to the macro.

When I compiled, all hell broke loose, ML.exe was crashing !!
I tried building a few times to confirm it, and even rebooted and tried again.
No, something was weird, ML was crashing, and if I commented the entire method out, the problem went away. It was in that method for sure.

I fixed a few bugs here and there and tried again.
This time ML.exe didn't crash but I got similar crazyness to what you describe.
After much tearing of hair, I found a small bug in that inline macro I'd defined.

Everything was groovy again !!

I believe the problem is caused by a combination of nesting a macro definition within a Method, and the fact that a Method is a macro already, ie, it's a bug in the macro nesting of ML.exe which only shows up under such conditions.
Posted on 2006-03-08 00:04:01 by Homer