News:

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

MACRO expansion operator trap

Started by jj2007, April 25, 2010, 06:15:15 PM

Previous topic - Next topic

jj2007

I have two macros, AnyMacro and JJ$. Consider this line inside a third macro:

Quote% AnyMacro AnyArg      ;; AnyMacro allows JJ$(ct-1)

While the line looks pretty harmless, the part marked in red behind a double ;; is actually being executed as JJ$(ct-1).
Without the expansion operator, it is just a comment.

It cost me a while to find out "who" generated this extra code (it crashed my app), so I thought I should share this with the MACRO crowd :wink

qWord

wow, what a bug! Or feature ?
... a new operator is born:
Quote%;    expand function like macro and discard return value

:U
FPU in a trice: SmplMath
It's that simple!

hutch--

Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php