![](/img/trans.png)
[英]Inconsistent behaviour of implicit conversion between unsigned and bigger signed types
[英]illegal implicit conversion of unsigned pointers
为什么这样编译:
char * tst1=0;
short * tst2=0;
tst1=tst2;
tst2=tst1;
但这不是:
unsigned char * tst1=0;
unsigned short * tst2=0;
tst1=tst2;
tst2=tst1;
这只是显示我得到的编译错误的一个示例。 我正在将项目从较旧的IDE移植到基于eclipse的较新IDE,并且该项目用于编译,而不是在Eclipse IDE上。
基本上,有很多用于编译但现在不合法的隐式转换。 我想知道造成这种情况的原因以及日食的可能解决方法,以使其再次发出警告。
原因可能是从eclipse传递到C编译器的参数不同。 尝试在以前的IDE配置中找到它们,或在其输出窗口中查找它们。 如果您当前的IDE是基于Eclipse的,那么您应该能够毫无问题地更新编译器设置(因为它可以在Eclipse上配置,并且不允许更改这样的设置是很疯狂的……)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.