IBM Support

IV53918: C COMPILER INCORRECTLY REPORTS THAT AN IDENTIFIER IS UNDECLARED

Fixes are available

XL C for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 8 (March 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 12 (May 2015 PTF) for 12.1
XL C/C++ for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 15 (April 2016 Update) for 12.1
XL C for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 16 (July 2016 Update) for 12.1
XL C/C++ for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 17 (November 2016 Update) for 12.1
XL C for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 18 (February 2017 Update) for 12.1
XL C for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C/C++ for AIX Fix Pack 19 (August 2017 Update) for 12.1
XL C for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C/C++ for AIX Fix Pack 20 (March 2018 Update) for 12.1
XL C for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 9 (July 2014 PTF) for 12.1
XL C for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C/C++ for AIX Fix Pack 10 (October 2014 PTF) for 12.1
XL C for AIX Fix Pack 11 (February 2015 PTF) for 12.1
XL C for AIX Fix Pack 13 (August 2015 Update) for 12.1
XL C for AIX Fix Pack 14 (December 2015 Update) for 12.1
XL C/C++ for AIX Fix Pack 21 (January 2019 Update) for 12.1
XL C for AIX Fix Pack 21 (January 2019 Update) for 12.1

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as program error.

Error description

  • The 'cc' compiler issues an error message related to an
    identifier even though the identifier has been declared.
    
    ======Compile Command:
    $ cc -c sample.c
    
    
    ======Test case:
    $ cat sample.c
    typedef signed long long        int64_t;
    typedef unsigned long long      uint64_t;
    typedef int64_t                 intmax_t;
    typedef uint64_t                uintmax_t;
    
    enum { SYSINT_BUFSIZE =
             (((((((sizeof (uintmax_t) * (8) - (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) + 1)) < ((((((sizeof (intmax_t) * (8) - (! ((__typeof__
    (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) + 1)) ? ((((((sizeof (intmax_t) * (8) - (! ((__typeof__
    (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) + 1)) : ((((((sizeof (uintmax_t) * (8) - (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) + 1))) };
    
    void
    show_snapshot_field_ranges (void)
    {
      char minbuf[((SYSINT_BUFSIZE) < ((((((sizeof (intmax_t) * (8)
    - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1)))
    * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 <
    (__typeof__ (intmax_t)) -1))) + 1)) ? ((((((sizeof (intmax_t) *
    (8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 <
    (__typeof__ (intmax_t)) -1))) + 1)) : (SYSINT_BUFSIZE))];
      char maxbuf[((SYSINT_BUFSIZE) < ((((((sizeof (uintmax_t) * (8)
    - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 <
    (__typeof__ (uintmax_t)) -1))) + 1)) ? ((((((sizeof (uintmax_t)
    * (8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__
    (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)) :
    (SYSINT_BUFSIZE))];
    }
    

Local fix

  • Use temporaries to store the size of minbuf and maxbuf
    
    
    typedef signed long long        int64_t;
    typedef unsigned long long      uint64_t;
    typedef int64_t                 intmax_t;
    typedef uint64_t                uintmax_t;
    
    enum { SYSINT_BUFSIZE =
             (((((((sizeof (uintmax_t) * (8) - (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) + 1)) < ((((((sizeof (intmax_t) * (8) - (! ((__typeof__
    (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) + 1)) ? ((((((sizeof (intmax_t) * (8) - (! ((__typeof__
    (intmax_t)) 0 < (__typeof__ (intmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) + 1)) : ((((((sizeof (uintmax_t) * (8) - (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) * 146 + 484) /
    485) + (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) + 1))) };
    
    void
    show_snapshot_field_ranges (void)
    {
      int temp1 = ((SYSINT_BUFSIZE) < ((((((sizeof (intmax_t) * (8)
    - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t)) -1)))
    * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 <
    (__typeof__ (intmax_t)) -1))) + 1)) ? ((((((sizeof (intmax_t) *
    (8) - (! ((__typeof__ (intmax_t)) 0 < (__typeof__ (intmax_t))
    -1))) * 146 + 484) / 485) + (! ((__typeof__ (intmax_t)) 0 <
    (__typeof__ (intmax_t)) -1))) + 1)) : (SYSINT_BUFSIZE));
      int temp2 = ((SYSINT_BUFSIZE) < ((((((sizeof (uintmax_t) * (8)
    - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__ (uintmax_t))
    -1))) * 146 + 484) / 485) + (! ((__typeof__ (uintmax_t)) 0 <
    (__typeof__ (uintmax_t)) -1))) + 1)) ? ((((((sizeof (uintmax_t)
    * (8) - (! ((__typeof__ (uintmax_t)) 0 < (__typeof__
    (uintmax_t)) -1))) * 146 + 484) / 485) + (! ((__typeof__
    (uintmax_t)) 0 < (__typeof__ (uintmax_t)) -1))) + 1)) :
    (SYSINT_BUFSIZE));
      char minbuf[temp1];
      char maxbuf[temp2];
    }
    

Problem summary

  • USERS AFFECTED:
    Users of typeof extension in array declare are affected by this
    issue.
    
    PROBLEM DESCRIPTION:
    The compiler fails to analyze symbols in [], if there is typeof
    keyword.
    

Problem conclusion

  • The compiler has been fixed to resolve the aboe error.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV53918

  • Reported component name

    XL C FOR AIX

  • Reported component ID

    5725C7100

  • Reported release

    C10

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-01-13

  • Closed date

    2014-03-18

  • Last modified date

    2014-03-19

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

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

    LI77954

Fix information

  • Fixed component name

    XL C FOR AIX

  • Fixed component ID

    5725C7100

Applicable component levels



Document information

More support for: XL C for AIX
Compiler

Software version: 12.1

Reference #: IV53918

Modified date: 19 March 2014