Fixes are available
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
APAR status
Closed as program error.
Error description
Consider the following example: cat $test.c #include <stdio.h> #include <stdlib.h> #define TOKENSTRING " ,;\t\15\n" #define FALSE 0 #define TRUE 1 static char *MyToken ( char *String, char *Delimiter ); int main ( void ) { char TestString[80]; char *s; sprintf ( TestString, "type var '[s] testfall'" ); s = MyToken ( TestString, TOKENSTRING ); printf ( "1 <%s>\n", s ); while ( s != NULL ) { s = MyToken ( NULL, TOKENSTRING ); printf ( "2 <%s>\n", s ); } return ( 0 ); } static char *MyToken ( char *String, char *Delimiter ) { /*-------------------------------------------------------------- / Do not account for delimiters found in [] or ''. / /------------------------------------------------------------* / static char *p = NULL; char *s, *Begin; int BracketOpen, Apostroph; if ( String != NULL ) p = String; else if ( p == NULL ) return ( NULL ); BracketOpen = Apostroph = FALSE; Begin = p; /*-------------------------------------------------------------- / '\0' and '\n' are taken as delimiters too. / /-------------------------------------------------------------*/ while ( (*p != '\0') && (*p != '\n') ) { /*------------------------------------------------------------ - / Account for [ and '. / Within brackets and apostrophs, / / no delimiters shall be evaluated. / ----------------------------------------------------- - -----*/ if ( *p == '[' ) BracketOpen = TRUE; if ( *p == '\'') Apostroph = !Apostroph; if ( !(BracketOpen || Apostroph) ) { /*------------------------------------------------------------- / We are outside brackets or apostrophs; / / thus we can evaluate the delimiter. / /------------------------------------------------------------*/ s = Delimiter; while ( *s != '\0' ) { if ( *p == *s ) { *p++ = '\0'; return ( Begin ); } s++; } } if ( *p == ']' ) BracketOpen = FALSE; p++; } if ( p != Begin ) { *p = '\0'; return ( Begin ); } else return ( NULL); } Compile it with -O2 and execute the binary: xlc -O2 test.c ./a.out Expected output: ./a.out 1 <type> 2 <var> 2 <'[s] testfall'> 2 <> <end of output> but the binary generates the following output: ./a.out 1 <type> 2 <var> 2 <'[s]> 2 <testfall'> 2 <> <end of output>
Local fix
Compile with noopt or -O3 and above.
Problem summary
Incorrect optimization
Problem conclusion
The problem had been fixed
Temporary fix
Comments
APAR Information
APAR number
IV55902
Reported component name
XL C/C++ AIX
Reported component ID
5724X1300
Reported release
C10
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2014-02-25
Closed date
2014-07-18
Last modified date
2014-07-18
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
5725C7100
Applicable component levels
Document Information
Modified date:
01 October 2021