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 Not under consideration
Workspace IBM i
Categories Languages - Other
Created by Guest
Created on Feb 8, 2019

Change sizeof(long) in C++ for DTAMDL(*LLP64) STGMDL(*TERASPACE)

Our company is a software vendor, and we have a product that runs on most platforms available today. Almost all of our builds are 64-bit.

On IBM i V7.3, we are compiling our product with DTAMDL(*LLP64) STGMDL(*TERASPACE), so the compilation environment is 64-bit. Most C++ compilers on 64-bit platforms have sizeof(long)=8.

The ILE C++ Programmer's Guide for IBM i V7.3 states that the size of a long int data type is 4 bytes. As IBM i V7.3 is a 64-bit platform, we wanted to check if it is possible to increase sizeof(long) to 8 bytes for the 64-bit compilation environment.


Use Case:

See the Description section.


Idea priority Medium
  • Guest
    Reply
    |
    May 14, 2020

    C/C++ standard does not define the size of 'long int', but just requires that: sizeof(int) <= sizeof(long int). Win64 also uses the LLP64 model, that means long on Windows 64bit is also 4bytes long, but on most Unix 64bit systems long is defined as 8 bytes long. Since IBM i has been using 4 bytes for long, we are not going to change it, otherwise incompatibility for existing programs will be introduced.
    I would suggest you define your own INT32, INT64 in your own program, especially if you are one copy of code for different platforms.

  • Guest
    Reply
    |
    Apr 27, 2020

    Due to processing by IBM, this request was reassigned to have the following updated attributes:
    Brand - Servers and Systems Software
    Product family - Power Systems
    Product - IBM i
    Component - Languages - Other
    Operating system - IBM i
    Source - None

    For recording keeping, the previous attributes were:
    Brand - Servers and Systems Software
    Product family - Programming Languages
    Product - C/C++ Compilers
    Component - Miscellaneous
    Operating system - IBM i
    Source - None

  • Guest
    Reply
    |
    Apr 24, 2020

    Hi, apologies for the delay.

    Thank you for the response. We have received it and will review it.
    Once we have an update, we shall update this RFE.

    Thanks.

  • Guest
    Reply
    |
    Aug 15, 2019

    Hello,

    The following program, when compiled and linked with DTAMDL(*LLP64) STGMDL(*TERASPACE), shows that sizeof(pointer) is 8 but sizeof(long) is 4.

    #include
    int main(void)
    {
    int sp = sizeof(void *);
    int sl = sizeof(long);
    printf("sizeof pointer = %d, sizeof long = %d\n", sp, sl);
    return (0);
    }

    The output:

    sizeof pointer = 8, sizeof long = 4.

    Please confirm that you have received the update. My previous comment posted on July 22 did not get acknowledged, and the request status is still "Additional Information Needed".

    Thank you.
    Lev Perelmuter

  • Guest
    Reply
    |
    Jul 22, 2019

    Strange, some time ago I added a comment providing the direct link requested by IBM (IBM_Rational_Developer) on June 5, 2019 but the case did not get updated. Trying again:

    https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzarh/sc092712.pdf
    IBM Rational Development Studio for iILE C/C++ Programmer's Guide
    Table 11-3 on page 11-3.

    In the table, the length of the "long int" type is shown to be 4 bytes.

  • Guest
    Reply
    |
    Jun 5, 2019

    Hi, our understanding is that in 64 bit, the size of long is 8bytes.

    Can you please provide the direct link where it states that its 4bytes?

  • Guest
    Reply
    |
    Apr 8, 2019

    This RFE is being investigated further.