content of bug
The result of strcmp() between a Kanji string sequence which is defined by the macro of
stringification operator and a Kanji string sequence which is enclosed by double quotation mark
does not become equal.
Kanji are Japanese characters.
The error occurs when Kanji filter is effective.
correspondence method
Invalidate Kanji filter.
When compiling from a command line, change "CC=xgcc_filt" into "CC=xgcc" in makefile(*.mak).
When compiling from IDE, invalidate the item of Kanji filter use in project property.
※ This bug has been resolved in Ver 1.5.0 or after.
reappearance code
#include <string.h>
#define str(a) #a
No.3
int main( void )
{
if( strcmp( str( "
cause
Kanji filter which changes a Kanji string sequence into ASCII sequence at the time of compile is effective by
the default.
When using macro of stringification operator, the compare of a Kanji string sequence does not become
equal. Because a Kanji string sequence is changed in the order of the following at the time of compile.
source code
Conversion by Kanji filter
Conversion by preprocessor
S5U1C17001C ManUal
(C COMPilEr PaCkagE fOr S1C17 faMily) (Ver. 1.5.0)
// macro of stringification operator
" ), "\"
\"" ) ) { // The result of compare should be equal, but is not equal.
str("
")
↓
str("\x8e\x9a")
↓
"\"\\x8e\\x9a\""
EPSOn
"\"
\""
"\"\x8e\x9a\""
"\"\x8e\x9a\""
6 C COMPilEr
6
Compiler
6-17
Need help?
Do you have a question about the S5U1C17001C and is the answer not in the manual?