Node:Parameter passing, Next:GPI files, Previous:Tree nodes, Up:Internals
GPC supports a lot of funny things in parameter lists:
protected
and const
parameters, strings with specified
or unspecified length, conformant arrays, objects as var
parameters, etc. All this requires sophisticated type-checking; the
responsible function is convert_arguments()
in the source
file typecheck.c
. Every detail can be looked up from there.
Some short notes about the most interesting cases follow.
maybe_call_function()
and probably_call_function()
in expressions.c
.
const
parameters:
const
parameter, GPC
assigns the value to a temporary variable whose address is passed.
Exception: Small types (whose size is known and not bigger than that
of a pointer) as well as all integer, real and complex types are
really passed by value.
var foo
or var foo: Void
and are
compatible to C's void *
parameters; the size of such
entities is not passed. Maybe we will change this in the
future and pass the size for var foo
parameters whereas
var foo: Void
will remain compatible to C. (Same with
const
instead of var
.)
CString
parameters:
Chr (0)
terminator.