Fixes are available
XL C/C++ for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C for AIX Fix Pack 15 (August 2013 PTF) for 11.1
XL C/C++ for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 17 (February 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C/C++ for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 21 (April 2015 PTF) for 11.1
XL C/C++ for AIX Fix Pack 22 (September 2015 PTF) for 11.1
XL C for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 23 (March 2016 PTF) for 11.1
XL C for AIX Fix Pack 24 (September 2016 PTF) for 11.1
XL C/C++ for AIX Fix Pack 24 (September 2016 PTF) for 11.1
XL C for AIX Fix Pack 16 (November 2013 PTF) for 11.1
XL C for AIX Fix Pack 18 (May 2014 PTF) for 11.1
XL C for AIX Fix Pack 19 (August 2014 PTF) for 11.1
XL C for AIX Fix Pack 20 (November 2014 PTF) for 11.1
XL C for AIX Fix Pack 22 (September 2015 PTF) for 11.1
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
IV39332
Reported component name
XL C FOR AIX
Reported component ID
5724X1200
Reported release
B10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-04-04
Closed date
2013-08-13
Last modified date
2013-08-13
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
XL C FOR AIX
Fixed component ID
5724X1200
Applicable component levels
Document Information
Modified date:
13 August 2013