wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
225 stars 30 forks source link

vararg is limited to be size of 31 #729

Open Krypt0n opened 5 years ago

Krypt0n commented 5 years ago

as the wurst manual says that "vararg" is unlimited in amount of values inside, see: https://wurstlang.org/manual.html#extension-functions "We can pass any amount of integers to the function"

it should be noted that the generated jass code can only handle up to 31 parameters, and therefore you cannot used more than 31 values for the vararg.

peq commented 5 years ago

Thanks for the hint. I was not aware of this limitation.

I just added a warning to the manual for now, but I think eventually we also want support more that 31 arguments. We could use a temporary global array variable to pass the arguments or force inlining (like @inline) for calls for functions with more that 31 arguments.