5.4 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 in future without breaking compatibility. To achieve this, 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 this document.
- 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 this document.
- 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 this document.
- 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:
- Callees can be enhanced to accept extra optional arguments.
- Callees can be enhanced to return extra return value members. Existing callers that are unaware of the new members will 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.