Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Delivered
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Mar 1, 2018

Change RPG compiler to require prototypes for exported procedures

With 7.1 the compiler was changed to not require prototypes for procedures of a RPG module. While that change is great for local procedures, it is really bad for exported procedures, because the compiler does not necessarily validate the prototype against the procedure interface. So it happened that one developer forgot to include the /copy member with the prototype to the module containing a certain procedure. Then, after a while the procedure interface was changed but not the prototype. Since the prototype was not included in the module with that procedure, it was not validated against the procedure interface and everything compiled just fine. But at runtime it came to a parameter error when the procedure in question was called by another procedure. The reason was that the caller used the old and wrong prototype, which did not match the procedure interface of the callee. Prototypes that are not validated against the procedure interface are dangerous and a huge step back to the old days of legacy parameter lists.


Use Case:

Application development must rely on prototypes that truly match the procedure interface. Otherwise writing modules and service programs with small and reusable procedures is not possible. If you do so though, you have to live with the risk of runtime errors due to a parameter mismatch.


Idea priority High
  • Guest
    Reply
    |
    Nov 12, 2020

    IBM believes that the request described has been solved and is available with PTFs for 7.3 and 7.4.

    There is a new REQPREXP (Require Prototypes for Exported Procedures) Control keyword. The default for this keyword is *NO, but you can also specify *WARN to cause the compiler to issue a severity-10 warning for missing prototypes or *REQUIRE to cause the compiler to issue a severity-30 error for missing prototypes.

    You can also specify REQPROTO(*NO) for any exported procedure or for the Procedure Interface of a cycle-main procedure if you know that a prototype is never needed for that procedure.

    There is also a new REQPREXP parameter for the CRTBNDRPG and CRTRPGMOD commands. If you do not obtain the PTF that provides the new parameter for the commands, you can still use the Control keyword aspect of the enhancement.

    PTFs for 7.3:
    - SI74612: TGTRLS(*CURRENT) compiler
    - SI74590: New REQPREXP parameter for CRTBNDRPG and CRTRPGMOD. This PTF is not needed for the Control keyword aspect of this enhancement. Please be sure to read the special instructions in the cover letter before applying this PTF.

    PTFs for 7.4:
    - SI74613: TGTRLS(*CURRENT) compiler
    - SI74614: TGTRLS(V7R3M0) compiler
    - SI74591: New REQPREXP parameter for CRTBNDRPG and CRTRPGMOD. This PTF is not needed for the Control keyword aspect of this enhancement. Please be sure to read the special instructions in the cover letter before applying this PTF.

    For more details, please see https://ibm.biz/rpgcafe_require_prototypes_for_exported_procedures

  • Guest
    Reply
    |
    Apr 17, 2020

    This request is still a candidate to be an enhancement for the RPG compiler.

    IBM will use this request as input to planning but no commitment is made or implied. This request will be updated in the future if IBM implements it. IBM will use votes and comments from others in the community to help prioritize this request.

    The current plan is that the compiler will provide a way for the RPG programmer to request a diagnostic message if there is an exported procedure without a prototype or if the main procedure does not have a prototype.

    By default, no message will be issued.

    A new H-spec keyword, such as REQEXTPR, will be added that will allow programmers to request that either a warning or error message be issued if there is no prototype for an exported procedure.

    Additionally, there will be a new command parameter, such as REQEXTPR, for CRTRPGMOD and CRTBNDRPG. It will default to *NO, but it will support values *WARN and *REQUIRE. It will be possible to use CHGCMDDFT to change the default.

  • Guest
    Reply
    |
    Mar 12, 2020

    IBM agrees with the request and a solution appears to be desirable and feasible. IBM intends to provide a solution. However, IBM's plans may change and no commitment is made that a solution will be provided.

    As discussed in the comments for this RFE, the current plan is that the compiler will issue a diagnostic message if there is an exported procedure without a prototype or if the main procedure does not have a prototype.

    By default, it will be a sev-10 warning message.

    A new H-spec keyword, such as DCLOPT(*REQEXTPR), will also be added that will cause a sev-30 message to be issued.

    Also, there may be a P-spec keyword, such as REQPROTO(*NO), that programmers can code on a specific exported procedure to say that no prototype is required. This could be useful for Java Native methods, which are normally only called by Java code.

  • Guest
    Reply
    |
    Feb 17, 2020

    The COMMON Europe Advisory Council (CEAC) has reviewed this requirement and recommends that IBM view this as a MEDIUM priority requirement that should be addressed.

    Background: The CEAC members have a broad range of experience in working with small and medium-sized IBM i customers. CEAC has a crucial role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community and has therefore reviewed your RFE.

    To find out how CEAC help to shape the future of IBM i, see CEAC @ ibm.biz/BdYSYj and the article "The Five Hottest IBM i RFEs Of The Quarter" at ibm.biz/BdYSZT

    Therese Eaton – CEAC Program Manager, IBM

  • Guest
    Reply
    |
    Jan 20, 2020

    Maybe consider to also let the compiler automatically export the prototypes, so they only have to be declared in the procedure it self. That will make it consistent all the way around.

    something like:

    EXPPATH('/mypath/')
    and/or
    EXPSRC(*LIBL/QRPGLEHDR')

  • Guest
    Reply
    |
    Apr 23, 2019

    The CAAC has reviewed this requirement and recommends that IBM view this as a high priority requirement that is important to be addressed. The warning message and possible escalation would lead toward more bullet-proof use of the RPG language.

    Background: The COMMON Americas Advisory Council (CAAC) members have a broad range of experience in working with small and medium-sized IBM i customers. CAAC has a key role in working with IBM i development to help assess the value and impact of individual RFEs on the broader IBM i community, and has therefore reviewed your RFE.

    For more information about CAAC, see www.common.org/caac

    For more details about CAAC's role with RFEs, see http://www.ibmsystemsmag.com/Blogs/i-Can/May-2017/COMMON-Americas-Advisory-Council-%28CAAC%29-and-RFEs/

    Nancy Uthke-Schmucki - CAAC Program Manager

  • Guest
    Reply
    |
    Jul 6, 2018

    IBM has received the requirement and is evaluating it. IBM will provide a response after evaluation is complete.

  • Guest
    Reply
    |
    Mar 8, 2018

    Mark's suggestion is a good one indeed. I think that it would be nice warning while linking too, whether liked modules have not the required interface.

  • Guest
    Reply
    |
    Mar 6, 2018

    I like Mark's compromise suggestion. A warning could be added without breaking compatibility and the ability to escalate it to an error would be good.

  • Guest
    Reply
    |
    Mar 6, 2018

    I like Mark's compromise suggestion. A warning could be added without breaking compatibility and the ability to escalate it to an error would be good.

  • Guest
    Reply
    |
    Mar 6, 2018

    Hi Mark, that's a good idea for the compiler to add a warning message, since there would be no compatibility issues.

    To escalate to an error, the compiler would add a new H spec keyword, plus possibly a new command parameter (but probably not a new OPTION, since it's impossible to change the command default for the OPTION parameter)

  • Guest
    Reply
    |
    Mar 5, 2018

    I think a meaningful compromise would be to have the ILE RPG IV compiler issue at least a "Warning" message when a Procedure Interface (PI spec) has the "EXPORT" keyword specified, but there is no corresponding Procedure declaration (PR spec) for that procedure.

    Also, it might be nice to have the compiler escalate that Warning to an "Error" message (that halts the compile) if some new keyword is specified on the H-spec, or in the default H-specs in the data area RPGHSPEC, so that a customer site can make it their "shop standard" to require a PR-spec for any exported PI spec.

    I think that would be a good step in the right direction.

  • Guest
    Reply
    |
    Mar 2, 2018

    @Bob_Cozzi, validating the call at bind time is much less likely to be implemented, since it would require changes by all the compilers as well as the binder. Indeed, it would need a different RFE.

  • Guest
    Reply
    |
    Mar 2, 2018

    Note that the compiler can't start requiring prototypes for exported procedures without some kind of option, since that would violate upward compatibility. So if this requirement is addressed, there would be an H spec option, plus possibly a command parameter.

  • Guest
    Reply
    |
    Mar 1, 2018

    Perhaps a more plausible option would be to validate the prototyped call at bind time. That is much more likely to be implemented than this request. But it might need to be a different RFE.