我要评分
获取效率
正确性
完整性
易理解

Symbols of Data Type char

Symptom

Alarm information: warning: comparison is always false due to limited range of data type

Possible Cause

The default symbols of the char variable vary according to different CPU architectures. In the x86 architecture, the default symbol is signed char. In the Arm64 platform, the default symbol is unsigned char. During porting, the char variable must be set to signed char.

Solution

Add the -fsigned-char compilation option to set the char variable in the Arm64 platform to signed char.