Fixes are available
XL C/C++ for Linux Fix Pack 8 (October 2015 Update) for 12.1
XL C/C++ for Linux Fix Pack 4 (October 2013 Update) for 12.1
XL C/C++ for Linux Fix Pack 5 (December 2013 Update) for 12.1
XL C/C++ for Linux Fix Pack 6 (February 2014 Update) for 12.1
XL C/C++ for Linux Fix Pack 7 (May 2014 Update) for 12.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
LI77612
Reported component name
XL C/C++ FOR LI
Reported component ID
5725C7300
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-10-28
Closed date
2013-10-28
Last modified date
2013-10-28
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/C++ FOR LI
Fixed component ID
5725C7300
Applicable component levels
RC10 PSN IV39332
UP06/09/13
[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSXVZZ","label":"XL C\/C++ for Linux"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"12.1","Line of Business":{"code":"LOB57","label":"Power"}}]
Document Information
Modified date:
14 October 2021