Rate This Document
Findability
Accuracy
Completeness
Readability

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.