GCC(ARM) warning: comparison is always true due to limited range of data type
2013-12-19 11:28
1216 查看
char ch;
while((ch = getopt(argc,argv,"d:h"))!=EOF
switch(ch{
case 'h'
...
GCC X86 OK!
GCC Arm 警告如下
warning: comparison is always true due to limited range of data type
改为int ch即可
The C and C++ standards allows the character type char to be signed or unsigned, depending on the platform and compiler. Most systems, including x86 GNU/Linux and Microsoft Windows, use signed char, but those based on PowerPC and ARM processors typically
use unsigned char.(29) This can lead to unexpected results when porting programs between platforms which have different defaults for the type of char.
while((ch = getopt(argc,argv,"d:h"))!=EOF
switch(ch{
case 'h'
...
GCC X86 OK!
GCC Arm 警告如下
warning: comparison is always true due to limited range of data type
改为int ch即可
The C and C++ standards allows the character type char to be signed or unsigned, depending on the platform and compiler. Most systems, including x86 GNU/Linux and Microsoft Windows, use signed char, but those based on PowerPC and ARM processors typically
use unsigned char.(29) This can lead to unexpected results when porting programs between platforms which have different defaults for the type of char.
相关文章推荐
- comparison is always true due to limited range of data type 编译warning
- 错误 No enclosing instance of type WallpaperService is available due to some intermediate constructor invocation
- [entity framework ] The conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
- No enclosing instance of type WallpaperService is available due to some intermediate constructor inv
- No enclosing instance of type SearchCommand is available due to some intermediate constructor invoca
- URL-encoded form data is not valid ,Operation is not valid due to the current state of the object
- the application is not licensed to create or modify schema for this type of data
- The application is not licensed to modify or create schema for this type of data 解决办法
- ** WARNING ** : Your ApplicationContext is unlikely to start due to a @ComponentScan of the default
- ArcGIS Engine中初始化许可常见问题归纳,the application is not licensed to create or modify schema for this type of data
- HOW TO: Change the Owner of a User-Defined Data Type That Is in Use in SQL Server 2000
- conversion of a char data type to a datetime data type resulted in an out-of-range datetime value.
- EF 6.0 The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. c#中的时间
- System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException: Operation is not valid due to the current state of the obj
- Warning: Input is changing an uncontrolled input of type text to be controlled...
- MFC下调试 出现 Warning: initial dialog data is out of range.
- Access restriction: The type XXX is not accessible due to restriction on required lib
- GCC出现warning: integer constant is too large for 'long' type"
- warning: no rule to process file * of type * for architecture i386
- Dynamics CRM2016 The value of field on record of type entity is outside the valid range问题的解决方法