IBM Support

LI74348: INVALID ARRAY DATA

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • ===== DESCRIPTION:
    When using an unsigned short array to store string characters,
    some values are stored incorrectly as a different value.
    
    ===== TESTCASE:
    #include <stdio.h>
    
    #define CHECK(a, b)                                      \
            if ( (long)(a) != (long)(b) )                    \
            { printf("Error %ld != %ld  (File: %s Line:      \
              %d)\n",(long)a,(long)b,__FILE__, __LINE__); }  \
            else {printf("Success %ld == %ld  (File: %s
              Line:%d)\n",(long)a, (long)b,__FILE__, __LINE__); }
    
    int main()
    {
            const unsigned short *s0 = u"\n\t\a\100XYZ";
    
            CHECK ( s0[0], 0xa );
            CHECK ( s0[1], 0x9 );
            CHECK ( s0[2], 0x7 );
            CHECK ( s0[3], 64 );    //a
            CHECK ( s0[4], 'X' );
    }
    
    ===== ACTUAL OUTPUT:
    Success 10 == 10  (File: TestCase.cpp Line:12)
    Success 9 == 9  (File: TestCase.cpp Line:13)
    Success 7 == 7  (File: TestCase.cpp Line:14)
    Error 16384 != 64  (File: TestCase.cpp Line: 15)
    Error 22528 != 88  (File: TestCase.cpp Line: 16)
    
    ===== EXPECTED OUTPUT:
    Success 10 == 10  (File: TestCase.cpp Line:12)
    Success 9 == 9  (File: TestCase.cpp Line:13)
    Success 7 == 7  (File: TestCase.cpp Line:14)
    Success 64 == 64  (File: TestCase.cpp Line: 15)
    Success 88 == 88  (File: TestCase.cpp Line: 16)
    

Local fix

  • N/A
    

Problem summary

  • Programmers who use hex or octal escape
    sequences in character or string literals.
    
    In certain instances, the generated code is incorrect.
    A complete (and detailed) list, provided above, is to be
    published in a Technote.
    

Problem conclusion

  • We fixed all instances of incorrect code generation
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI74348

  • Reported component name

    XL C/C++ SLES10

  • Reported component ID

    5724U8300

  • Reported release

    A10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2009-03-31

  • Closed date

    2009-03-31

  • Last modified date

    2009-03-31

  • APAR is sysrouted FROM one or more of the following:

    IZ39039

  • APAR is sysrouted TO one or more of the following:

    LI74416

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels

[{"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"A.1","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
16 October 2021