| |||||||||||||
Technical Support On-Line Manuals RealView Compiler User's Guide | Placing ARM function qualifiers
Many ARM keyword extension modify the behavior or calling sequence of a function. For example, These function modifiers all have a common syntax. A function modifier such as
For simple function declarations, each syntax is unambiguous. However, for a function whose return type or arguments are function pointers, the prefix syntax is imprecise. For example, the following function returns a function pointer, but it is not clear whether __pure int (*foo(int)) (int); /* declares 'foo' as a (pure?) function that returns a pointer to a (pure?) function. It is ambiguous which of the two function types is pure. */ In fact, the single In contrast, the postfix syntax because it enables a clear distinction between whether int (*foo1(int) __pure) (int); /* foo1 is a pure function returning a pointer to a normal function */ int (*foo2(int)) (int) __pure; /* foo2 is a function returning a pointer to a pure function int (*foo3(int) __pure) (int) __pure; /* foo3 is a pure function returning a pointer to a pure function */ In this example:
Because the postfix syntax is more precise than the prefix syntax, it is recommended that, where possible, you make use of the postfix syntax when qualifying functions with ARM function modifiers. | ||||||||||||
| |||||||||||||