#pragma warning( disable : 4800 ) // forcing bool 'true' or 'false' ,忽略4800 警告
#pragma warning( disable : 4786 ) // truncating debug information to 255 chars  忽略4786 警告

 
'type' : forcing value to bool 'true' or 'false' (performance warning)

This warning is generated when a value that is not bool is assigned or coerced into type bool. Typically, this message is caused by assigning int variables tobool variables where the int variable contains only values true and false, and could be redeclared as type bool. If you cannot rewrite the expression to use typebool, then you can add "!=0" to the expression, which gives the expression type bool. Casting the expression to type bool will not disable the warning, which is by design.

The following sample generates C4800:

// C4800.cpp
// compile with: /W3
int main() {
int i = 0; // try..
// bool i = 0; bool j = i; // C4800
j++;
}

Compiler Warning (level 3) C4800的更多相关文章

  1. Compiler Warning (level 2) CS0436

    https://docs.microsoft.com/en-us/dotnet/csharp/misc/cs0436 // CS0436_a.cs // compile with: /target:l ...

  2. Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead的解决办法

    今天在导入工程进Eclipse的时候竟然出错了,控制台输出的是: [2013-02-04 22:17:13 - takepicture] Android requires compiler compl ...

  3. Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead. Please use Android Tools>Fix project Properties.

    重装操作系统之后,或者破坏了Android的开发环境之后,需要重新配置好Android的开发环境.但是配置好后,导入原有的项目时,报错: Android requires compiler compl ...

  4. Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead

    Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead 在解决问题Underscores can only ...

  5. Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead. Please use Android Tool

    重装操作系统后,要重新配置Android开发环境.配置成功后,添加原本项目时却出现了错误! Android requires compiler compliance level 5.0 or 6.0. ...

  6. Eclipse编译Android项目时出现的问题:Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead.

    Consle: Android requires compiler compliance level 5.0 or 6.0. Found '1.8' instead. Please use Andro ...

  7. Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead.解决方法

    今天在eclipse里报这个错误: Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Please ...

  8. Eclipse工程中Java Build Path中的JDK版本和Java Compiler Compiler compliance level的区别(转)

    在这里记录一下在eclipse中比较容易搞混淆和设置错误的地方.如下图所示的功能: 最精准的解释如下: Build Path是运行时环境  Compiler是编译时环境  假设,你的代码用到泛型,Bu ...

  9. Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead的解决的方法

    今天在eclipse里报这个错误:   Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead. Plea ...

随机推荐

  1. 为Visual Studio更换皮肤和背景图

    最近在博客上别人在老早之前就有加了背景图,想想怎么能这么out,于是乎,百度一下,能否知道? 咳咳,资源还是有滴!可惜都是比较旧的跟新版本的配置方法可能有点不一样, 可能会有很多人会觉得不适应,不过没 ...

  2. 百度Android定位SDK获取位置

    http://gis.sunxianlei.cn/2013/01/27/%E7%99%BE%E5%BA%A6android%E5%AE%9A%E4%BD%8Dsdk%E8%8E%B7%E5%8F%96 ...

  3. Matlab中数组元素引用——三种方法

    Matlab中数组元素引用——三种方法   1.Matlab中数组元素引用有三种方法 1 2 3 1.下标法(subscripts) 2.索引法(index) 3.布尔法(Boolean) 注意:在使 ...

  4. MinHash算法

    MinHash是用于快速检测两个集合的相似性的方法.改方法由Andrei Broder(1997)发明,并最初用于搜索引擎AltaVista中来检测重复的网页的算法.它同样可以用于推荐系统和大规模文档 ...

  5. Hotspot内存溢出测试

    一.堆溢出 在执行代码时通过设置堆的最小值-Mms以及堆的最大值-Mmx来控制堆的大小,-XX参数dump出堆内存快照以便对内存溢出进行分析.通过创建大量对象来使堆溢出,当堆内存溢出时会提示OutOf ...

  6. c++中STL库简介及使用说明

    作为C++标准不可缺少的一部分,STL应该是渗透在C++程序的角角落落里的.STL不是实验室里的宠儿,也不是程序员桌上的摆设,她的激动人心并非昙花一现.本教程旨在传播和普及STL的基础知识,若能借此机 ...

  7. 【心得】怪异的JS的Date函数

    我们知道new Date('2013/1/1')是2013年1月1日, 那么new Date('2013/1/366')会报无效日期格式吗?答案是,这是一个有效的日期,但是他是表示2014年1月1日. ...

  8. HTML 5 video 标签跨浏览器兼容

    <video width="320" height="240" controls>   <source src="movie.mp4 ...

  9. C#元组示例详解

    元组的概要: 数组合并了相同类型的对象,而元组合并了不同类型的对象.元组起源于函数编程语言(如F#) ,在这些语言中频繁使用元组.在N盯4中,元组可通过.NET Fmmework用于所有的NET语言. ...

  10. eclipse-debug时直接进入/不进入/提示进入调试页面修改

    eclipse使用debug调试程序时 默认设置每次程序走到断点位置时提示是否进入调试页面(如图) 而个人习惯有些系统直接进入调试页面.也有些人系统不进入调试页面调试 在这里勾选Remember my ...