Oh. I think I missed something. Pointer conversion will automatically take place for C and C++ programs. Does the RPG compiler / runtime automatically convert pointers? If I take the result of my program my guess is that it doesn't.
Is the solution to build a C wrapper service program for the "real" service program which contains a wrapper procedure for every procedure containing pointer as return values or parameters, so that they will be converted from 16 byte to 8 byte and vice versa?
From: c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx [mailto:c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Friday, June 04, 2010 9:24 PM
Subject: Re: [C400-L] pointers in different storage models
On 6/4/2010 5:44 AM, Schmidt, Mihael wrote:
Now I have just read that in 7.1 RPG modules can be compile with the
storage model *teraspace. Does that mean that the pointer in RPG will
also be 8 byte and that the calling to the procedure might work with
7.1 because it is the same storage model?
No, even with storage model *teraspace, RPG will still only support 16
You will have to use 16 byte pointers in the parameter interfaces
between C and RPG. The C modules can use 8 byte pointers internally.
Here is a page from the C/C++ manual about specifying 8 or 16 byte
pointers in prototypes:
Here is a page from ILE Concepts about pointer conversions: