136
int access (int *array, int index)
{
if (index
goto failure;
return array[index + offset];
}
int i;
/* ... */
for (i = 0; i
/* ... */ access (array, i) /* ... */
/* ... */
return 0;
/* Control comes here from
if it detects an error.
failure:
return -1;
}
A nested function always has internal linkage. Declaring one with
to declare the nested function before its definition, use
function declarations).
bar (int *array, int offset, int size)
{
__label__ failure;
auto int access (int *, int);
/* ... */
int access (int *array, int index)
{
if (index
goto failure;
return array[index + offset];
}
/* ... */
}
6.5. Constructing Function Calls
Using the built-in functions described below, you can record the arguments a function received, and
call another function with the same arguments, without knowing the number or types of the arguments.
You can also record the return value of that function call, and later return that value, without knowing
what data type the function tried to return (as long as your caller expects that data type).
However, these built-in functions may interact badly with some sophisticated features or other exten-
sions of the language. It is, therefore, not recommended to use them outside very simple functions
acting as mere forwarders for their arguments.
void *
__builtin_apply_args
perform a call with the same arguments as were passed to the current function.
The function saves the arg pointer register, structure value address, and all registers that might be used
to pass arguments to a function into a block of memory allocated on the stack. Then it returns the
address of that block.
size)
size; i++)
access
*/
size)
() This built-in function returns a pointer to data describing how to
Chapter 6. Extensions to the C Language Family
extern
(which is otherwise meaningless for
auto
is erroneous. If you need
Need help?
Do you have a question about the ENTERPRISE LINUX 4 and is the answer not in the manual?
Questions and answers