The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: jj2007 on April 25, 2010, 06:15:15 PM

Title: MACRO expansion operator trap
Post by: jj2007 on April 25, 2010, 06:15:15 PM
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
Title: Re: MACRO expansion operator trap
Post by: qWord on April 25, 2010, 06:34:20 PM
wow, what a bug! Or feature ?
... a new operator is born:
Quote%;    expand function like macro and discard return value

:U
Title: Re: MACRO expansion operator trap
Post by: hutch-- on April 26, 2010, 02:26:53 AM
 :bg