News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

ML Nonfatal Error A2127

Started by GoneFishing, November 24, 2015, 02:33:48 AM

Previous topic - Next topic

GoneFishing

Let me get started with a rhetorical question
Where's qWord?
Seems I have encountered a sort of  limitation  in METHOD macro which I'm using  to define some .NET interfaces:
Quote
; METHOD macro by qWord
METHOD MACRO name,args:VARARG
    LOCAL   _type1,_type2
    _type1  TYPEDEF PROTO args
    _type2  TYPEDEF PTR _type1
    EXITM   <name _type2 ?>
ENDM

6 functions have 9,10,11 and 12 arguments which are named structures  or enum pointers (all of them are rather long words) .
I'm getting this Error A2127 with ML v6.14:
Quote

macro function argument list too long

There were too many characters in a macro function's argument list. This error applies also to a prologue macro function called implicitly by the PROC directive.


I want to know how many characters are allowed in total here . Maybe someone had experienced the same limitation ?  Is there a way to avoid it?

GoneFishing

Got it !
ML v9.0 gives the same error
JWASM v2.12 - 0 warnings, 0 errors  :t
Superiority :dazzled:
Well , Let me conclude  with another rhetorical question
Where's Japheth?

dedndave

when you create these prototypes, you don't have to use the symbol name - just the type

  METHOD(CopyHere,     _this:LPVOID,vtItem:DWORD,vI0:DWORD,vdwItem:DWORD,vIV0:DWORD,vtOpt:DWORD,vO0:DWORD,vdwOpt:LPVOID,vOV0:DWORD)

this one would probably work just as well...
  METHOD(CopyHere,     :LPVOID,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:DWORD,:LPVOID,:DWORD)

GoneFishing

Yes, I know it , Dave
Definitey it's  a possible workaround for MASM, thank you  :t
In my case all  the symbol names  are  meaningful and I don't want to lose that info

jj2007

I wonder if there is not a limitation in the macro itself. Below code for testing max line length with 22 args: it works for JWasm and AsmC, it works even for 6.14, but replace
VeryLongArgument5:zz
with
VeryLongArgument5:DWORD
to see that >512 bytes is "line too long" for ML 6.14.

If you keep the line short but use more than 24 args, the error will be "statement too complex", even for JWasm & AsmC.

include \masm32\include\masm32rt.inc

zz typedef DWORD

MyTest PROTO VeryLongArgument1:DWORD, VeryLongArgument2:DWORD, VeryLongArgument3:DWORD, VeryLongArgument4:DWORD, VeryLongArgument5:zz, VeryLongArgument6:zz, VeryLongArgument7:zz, VeryLongArgument8:zz, VeryLongArgument9:zz, VeryLongArgument10:zz, VeryLongArgument11:zz, VeryLongArgument12:zz, VeryLongArgument13:zz, VeryLongArgument14:zz, VeryLongArgument15:zz, VeryLongArgument16:zz, VeryLongArgument17:zz, VeryLongArgument18:zz, VeryLongArgument19:zz, VeryLongArgument20:zz, VeryLongArgument21:zz, LongArg22:zz
.code

start: invoke MyTest, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
print "ok"
exit

MyTest proc VeryLongArgument1, VeryLongArgument2, VeryLongArgument3, VeryLongArgument4, VeryLongArgument5, VeryLongArgument6, VeryLongArgument7, VeryLongArgument8, VeryLongArgument9, VeryLongArgument10, VeryLongArgument11, VeryLongArgument12, VeryLongArgument13, VeryLongArgument14, VeryLongArgument15, VeryLongArgument16, VeryLongArgument17, VeryLongArgument18, VeryLongArgument19, VeryLongArgument20, VeryLongArgument21, LongArg22
  ret
MyTest endp

end start

GoneFishing

Interesting, JOCHEN  :t
My definitions look even more complex:
Quote
SomeInterfaceStruct STRUCT
     ...
     METHOD(SomeFunc,  _this:LPVOID, VeryLongPointerToSomeStruct:ptr SomeOtherInterfaceStructName, ... ...
     ...