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?

Mihael

-----Original Message-----
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
To: c400-l@xxxxxxxxxxxx
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
byte pointers.

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:
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=/rzarf/prag_datamodel.htm

Here is a page from ILE Concepts about pointer conversions:
http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp?topic=/ilec/sc41560685.htm

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact [javascript protected email address].