[fpc-devel] Error: Procedure/Function declared with call option NOSTACKFRAME but without ASSEMBLER

Marco van de Voort fpc at pascalprogramming.org
Thu Mar 20 20:23:17 CET 2025


Op 20-3-2025 om 20:09 schreef Martin Frb via fpc-devel:
> It is possible to declare a type for a cdecl function like
> type  a=procedure cdecl;
>
> But, not for "assembler" which makes sense, because its not a calling 
> convention. Same should likely be the case for NoStackframe.

Roughly yes. Basically a procedure variable is a contract which should 
give the calling situation enough information to call the said function.


> But
>
> program Project1;
> type  a=procedure {assembler} NoStackFrame ;
> begin
> end.
>
assembler is a comment?


> gives a different error?

Which error do you mean? Not to be facetious, just that errors might 
depend on architecture.


> Should it?
>
The bar is twofold, the first, as said,  being that the calling side 
must have enough information to call the result in all circumstances 
(read: on all targets), and the second , minor one, if that if there is 
an exception for parameterless functions, if it is worth to implement an 
exception.




More information about the fpc-devel mailing list