警告:“semantics of '>' change in ANSIC”的意思
来源:互联网 发布:数据库查询算法 编辑:程序博客网 时间:2024/05/21 22:54
这是某些编译器提出的警告,指出有些代码在ANSIC的“值保护” 规则下得到的结果可能跟老的“无符号保护”规则下得到的结果不同。
实际上改变的并不是>操作符的语义,而是当两个不同类型出现在二元操作符的两侧或者对短的整数类型进行提升时总是发生的隐式类型转换语义、(如果你觉得在表达式中没有使用任何无符号值,那么最可能是strlen函数,在标准C中,strlen返回size_t,无符号类型)
在实际应用中,当二元操作符的一个操作数是int 而另一个操作数可能是int 或unsigned int 型时,无符号和值保护规则的区别最大。如果一个操作数是unsigned int, 而另一个会被转换为这个类型-如果其值为负的话,这一定会导致不可预测的结果。
如果unsigned int 和int 出现在二元操作符两侧,则两个操作数都会转换为unsigned int。
0 0
- 警告:“semantics of '>' change in ANSIC”的意思
- The Semantics of Data
- The Semantics of Data
- The Semantics of Function
- Move semantics of RapidJSON
- Semantics in CG language
- A summary of Change in systemverilog 2012
- Operational Semantics in Programing Language (编程语言的操作语义)
- Jenkins -- #of executor 的意思
- ON CHANGE OF 的使用方法
- Access、Modify、change三个时间的意思以及修改方法
- xcode 中出现 Implicit declaration of function 'xxxx' is invalid in C99” 警告的解决办法
- Implicit declaration of function ‘xxxx’ is invalid in C99” 警告的解决办法
- Altium 原理图出现元件“Extra Pin…in Normal of part ”警告的解决方法
- warining:incompatible implicit declaration of built-in function 警告的解决方法
- Change Label of Taskbar Icons Show In Groups
- How to: Change color of rows in GridView on mouseover
- Change Log of Joomsport: Error in Joomsport (Synchronized with Server)
- CSDN 的博客太烂了
- GOTO语句利弊
- s5p4418 android 驱动 hal 应用之led 串口 rs485 can总线应用(JNI层)
- 有关于android模拟器的问题(不定期更新)
- 修炼成数据达人
- 警告:“semantics of '>' change in ANSIC”的意思
- IOS 问题总结一 frame 和scrollView
- Android获取图片资源之——拍照后在程序中显示照片
- P51 第八题
- Unity3D - 图形性能优化:渲染统计窗口
- 正则表达式的应用
- Codeforces Round #297 (Div. 2) —— A. Vitaliy and Pie
- XML跨平台,你懂的
- hdu4283 区间dp