IBM Support

LI76875: CTYPE.H FUNCTIONS AS MACROS IN CCTYPE

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • Defining _ILS_MACROS enables the inline function-like macros for
    functions defined in <ctype.h>.  Attempting to use the C++
    compliant wrapper <cctype> with _ILS_MACROS enabled will result
    in a syntax error if the ctype functions are called using the
    std namespace qualifier.
    
    
    << Example Code >>
        16          a = std::isupper(b);
    
    << Preprocessing >>
        16          a = std::(((b)>=0&&(b)<=256) ?
                            ((__lc_ctype).obj->mask[b]&0x400):0);
    
    << ERROR >>
    "test.cpp", line 16.18:1540-0063 (S) The text "(" is unexpected.
    
    
    The syntax error is cause by the std namespace no longer having
    a member to refer to due to the expanded function-like macro.
    

Local fix

  • - Use <ctype.h> and no namespace in C++ when using _ILS_MACROS
    

Problem summary

  • PROBLEM DESCRIPTION:
    Usage of the _ILS_MACROS macro replaces ctype function calls
    with inline macros.  This is done for performance reasons by
    avoiding C runtime function call overhead.  The macro
    substitution is causing an error when specifing the std
    namespace.
    
    USERS AFFECTED:
    Users who define _ILS_MACROS
    

Problem conclusion

  • Inline functions were added to the <cctype> header file to
    enable the macro versions of the ctype functions when
    specifying the std namespace.  Defining _ILS_MACROS with
    <cctype> will now require function inlining to be enabled (-Q
    or -qinline) to inline the ctype functions.
    

Temporary fix

Comments

APAR Information

  • APAR number

    LI76875

  • 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

    2012-07-16

  • Closed date

    2012-07-16

  • Last modified date

    2012-07-16

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

    IV10513

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

Fix information

  • Fixed component name

    XL C/C++ SLES10

  • Fixed component ID

    5724U8300

Applicable component levels



Document information

More support for: XL C/C++

Software version: A.1

Reference #: LI76875

Modified date: 16 July 2012


Translate this page: