× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



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

As an Amazon Associate we earn from qualifying purchases.

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-2024 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 on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.