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 Future consideration
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Aug 10, 2021

A new OPTION to force pointer declaration

A new OPTIONs to force explicit declaration of pointer type variables.


Use Case:

Developing programs


Idea priority Low
  • Guest
    Reply
    |
    Aug 26, 2021

    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.

    This feature would most likely be implemented as a new value for the DCLOPT keyword, such as DCLOPT(*NOIMPLICIT). It would apply to other implicit declarations (the parameters for the COMMIT and DEVID file definition keywords).

  • Guest
    Reply
    |
    Aug 13, 2021

    We're thinking that if we implement this item, it would probably be a new option for the DCLOPT Control keyword rather than a new value for the OPTION parameter and OPTION keyword.

  • Guest
    Reply
    |
    Aug 13, 2021

    Mark, if there were some new option to prevent the compiler from implicitly defining a BASED pointer, I think it would probably not even be allowed to define a local variable based on a global pointer.

    The compiler can't start using a global pointer if the local pointer is not defined.

    But even aside from the issue I mentioned, there's also the issue Niels mentioned, where the programmer mistypes the pointer for the BASED keyword.

  • Guest
    Reply
    |
    Aug 12, 2021

    I see the issue, but how would an option correct this particular problem? by causing a compile time error? At least the programmer would know that the global pointer wouldn't be automatically attached as the basing pointer. I'm torn between yea and nay on this one. In general I don't like globals, but they do have a limited place. Maybe a better way to handle this is if you would just use the global if it were defined as a pointer. That is really what most people would expect since the basing pointer need not create a new pointer. Or maybe implicit definitions should always use a like defined global if one exists. They use a like defined local if one exists and even error out if the like named local is defined differently. We are getting into some complicated name resolution routines here.

  • Guest
    Reply
    |
    Aug 11, 2021

    In case anyone is not aware of the issue here, RPG implicitly defines a pointer if it is used with the BASED keyword. This can cause unexpected behaviour if you use the BASED keyword in a procedure expecting the variable to be based on a global pointer. Instead, the compiler defines a local pointer.

    dcl-s g_ptr pointer;
    dcl-s storage char(10);
    g_ptr = %addr(storage);
    p1();
    return;

    dcl-proc p1;
    dcl-s based_fld char(10) based(g_ptr); // A local g_ptr will be implicitly defined by the compiler
    dsply based_fld; // error, pointer not set
    end-proc;

  • Guest
    Reply
    |
    Aug 11, 2021

    @NielsLiisberg not that type of declarations, only to prevent run time errors when you declare something like:
    Dcl-s CodeList like(code) dim(10) based(p_CodeList);
    Dcl-s x_CodeList pointer inz(%addr(CodeFields));
    Note x_ and p_

  • Guest
    Reply
    |
    Aug 11, 2021

    Can you elaborate on this: Do you think about strongly types pointers like in C / C++ . for example "pointer to int"