[Vm-dev] Primitives return what?

Stuart Cassoff aa72 at bell.net
Sun Apr 8 22:52:44 UTC 2018


Apologies in advance for not doing enough homework.

>From what I can understand so far:
- Primitive function signatures specify returning an sqInt but the returned value is never used.
- Primitives generally don't themselves return values, they often just drop off the end of the function.
- Most (all?) primitive code is generated by VMMaker.

Compiling results in warnings: "non-void function should return a value".

So I'm wondering if  the code generator could add "return 0;" (return 1; ?) where needed,
or could the functions be generated with a void signature instead of sqInt.

That is, iiuc, if the returned values from primitives are ignored.
If they are, I think that's a bit of a bummer because that's a wasted communications channel.


Any clarification appreciated,


Stu


More information about the Vm-dev mailing list