4.23 Compatibility rules for function callers and callees
Functions are called by name and function arguments are named, not positional. Function return values are often objects, or arrays of objects, that contain named values.
These principles allow Arm to enhance the interface without breaking compatibility. To
achieve this compatibility, callers and callees must follow some rules.
Callers of functions must follow these rules:
- The argument list must contain all mandatory arguments.
- The argument list can contain any optional arguments.
- The argument list must not contain any arguments that are not listed in the Iris documentation.
- The caller can rely on mandatory members in the return value objects.
- The caller must not rely on any optional members in the return value objects. If an optional
return value member is missing, this must have the semantics described in the
- The caller must accept and ignore any unknown members in return value objects.
Callees, in other words function implementations, must follow these rules:
- If a mandatory argument is missing, an error must be returned.
- If an optional argument is missing, this must have the semantics described in the Iris
- If an unknown argument is passed, an error must be returned.
- All mandatory members must be returned in the return value objects.
- Any set of optional members of return values can be returned in the return value objects.
These rules have the following implications when enhancing interfaces:
- Callees can be enhanced to accept more optional arguments.
- Callees can be enhanced so that they return additional return value members. Existing callers that are unaware of new members ignore them.
- Callers that rely on certain mandatory or optional arguments must reliably
receive an error response if a new argument is not supported by the callee.