GPC supports a lot of funny things in parameter lists: value and
reference, protected
and const
parameters, strings and
other schemata with specified or unspecified discriminants,
conformant and open arrays, objects, procedural parameters, untyped
reference 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
.
CString
parameters:
Chr (0)
terminator when necessary.
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
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
.)