IBM Support

IV49626: INCORRECT WARNING ON RESTRICT POINTER TYPE

Fixes are available

XL C/C++ for AIX Fix Pack 5 (September 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 7 (January 2014 PTF) for 12.1
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 5 (September 2013 PTF) for 12.1
XL C for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C/C++ for AIX Fix Pack 6 (December 2013 PTF) for 12.1
XL C for AIX Fix Pack 7 (January 2014 PTF) 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 testcase xlc_typedef_restrict.c below shows C compiler
    warning about incorrect usage of the restrict keyword, while
    the usage is correct. C++ compiler takes it happily with no
    warning message.
    
    ===== TESTCASE:
    $cat xlc_typedef_restrict.c
    #include <stdlib.h>
    
    struct foobar { void (*fp)(void *); };
    struct baz { const struct foobar *p; };
    struct foo { int a, b;  struct baz c; };
    typedef struct foo *bar;
    
    void func(struct foo* restrict p, struct foo* restrict q) {}
    
    void funk(bar restrict p, bar restrict q) {}
    
    int main()
    {
            bar p,q;
            bar restrict l;
            struct foo* restrict m;
            func(p,q);
            funk(p,q);
    }
    
    xlc  -c xlc_typedef_restrict.c
    "xlc_typedef_restrict.c", line 10.11: 1506-404 (W) restrict can
    only qualify a pointer type.
    "xlc_typedef_restrict.c", line 10.27: 1506-404 (W) restrict can
    only qualify a pointer type.
    "xlc_typedef_restrict.c", line 15.9: 1506-404 (W) restrict can
    only qualify a pointer type.
    

Local fix

  • Change
    struct foobar { void (*fp)(void *); };
    
    To
    struct foobar { void (**fp)(void); };
    

Problem summary

  • PROBLEM DESCRIPTION: Incorrect diagnose message of restrict
    pointer.
    
    USERS AFFECTED: Programs using restrcit qualifier on a
    struct/union pointer which contain function pointer member.
    

Problem conclusion

  • Problem is fixed. The warning message is not emitted. Apply
    provided service.
    

Temporary fix

Comments

APAR Information

  • APAR number

    IV49626

  • 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

    2013-09-18

  • Closed date

    2013-09-18

  • Last modified date

    2013-09-20

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

    IV39332

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

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 #: IV49626

Modified date: 20 September 2013