Accelerator Manual (G06.27+, H06.04+, J06.03+)
Preparing Your Program for the Accelerator
Accelerator Manual—527303-003
3-11
Non-Standard Procedure Call or Return RP Values
The Accelerator issues the following warning when you accelerate the preceding
procedure:
Warning 32: The return value sizes derived for the following
procedures conflict with those given in the Binder region:
'main'; 7 derived by the Accelerator;
1 given in the Binder region
'f'; 2 derived by the Accelerator;
0 given in the Binder region
Acceleration is based on the Binder region; you can override
that value with a ReturnValSize option.
Instead of recompiling, you can use the following ReturnValSize option to produce a
correctly accelerated program:
ReturnValSize 'f' 2
•
This example shows a function that returns a struct by value. You must either
recompile this program with a version of the C compiler released on or after
15JUN91 or specify a ReturnValSize option.
#pragma runnable
#include <stdioh> nolist
#include <stdlibh> nolist
struct TAG {
int I;
long L;
};
struct TAG Foo (void); /* function returns type TAG */
struct TAG Foo (void)
{
struct TAG *ATagStruct;
ATagStruct = (struct TAG *) malloc ( sizeof (struct TAG));
ATagStruct->I = 1;
ATagStruct->L = 2;
return *ATagStruct; /* by value */
}
main ()
{
struct TAG TagStruct;
TagStruct = Foo();
printf ( "TagStruct is %d %ld, should be 1 2\n",
TagStruct.I, TagStruct.L);
}