× 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.



Hi David,

A compiler takes your source code and generates machine code. The phrase EXTPROC(*CL) on a prototype tells the compiler to generate different machine code than you'd have if you didn't use EXTPROC(*CL). You have to recompile everything in order for the system to generate the new machine code.

The issue is that IBM i 6.1 changed the way parameters are passed under the covers at machine level. They put code in there to preserve backward compatibility -- but the problem was, RPG and CL pass 1-byte return values differently from one another. This would cause the call to fail if there's a 1-byte return value. Using EXTPROC(*CL) tells RPG to use CL's calling convention, which solves the problem.

Prior to the underlying machine changes in 6.1, you could workaround this problem another way... you could code the return value as a 2-byte return value in CL. This no longer works at 6.1. So the only fix is to change the procedure to Extproc(*CL) This unfortunately changes the machine code that RPG compiles, and therefore, any existing routines (including RPG routines) that call that procedure will need to also be recompiled so that they also use the new calling convention.



David FOXWELL wrote:
Hello all,

Just received from management this extract of an IBM memo :

If a single version of the CL program must be able to run on multiple releases that include V6R1 and a
previous release, then the source of the RPG procedure being called also requires a change. Change the
RPG source by adding the EXTPROC(*CL) keyword to the prototype (PR) and procedure interface (PI).
Any RPG programs or modules that call the changed RPG procedure must be recompiled.

Manager asks why it would be necessary to recompile all callers, as in our shop they are all bound by copy. Does the memo assume that the prototype modified is the prototype of a service program subprocedure?
Anyone know where I can find the original memo on the web?

Thanks.



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.