vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
来源:互联网 发布:网络高科技犯罪电视剧 编辑:程序博客网 时间:2024/05/22 05:33
查MSDN得:
size_t unsigned integer Result of sizeof operator. STDDEF.H and other include files
出现C4276 warning是因为测试 32位代码的64位兼容性问题而出现的警告,由/WP64开关控制,默认是打开的。
size_t 是针对系统定制的一种数据类型,一般是整形,因为C/C++标准只定义一最低的位数,而不是必需的固定位数。而且在内存里,对数的高位对齐存储还是低位对齐存储各系统都不一样。为了提高代码的可移植性,就有定议le 这样的数据类型。
size_t 在32位系统上定义为 unsigned int,在64位系统上定义为 unsigned long.
STDDEF.H的内容
#ifndef _SIZE_T_DEFINED
#ifdef _WIN64
typedef unsigned __int64 size_t;
#else
typedef _W64 unsigned int size_t;
#endif
#define _SIZE_T_DEFINED
#endif
解决方法:(注:本人的是vs2005)
Project ->Properties ->C/C++ ->General-> Detect 64bit Portability Issues,设置成否
阅读全文
0 0
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
- warning C4244: '=' : conversion from 'int' to 'float', possible loss of data
- How to eliminate the compile error "conversion from 'double ' to 'float ', possible loss of data"
- 使用CodeWarrior编译时出现Warning:Possible loss of data
- warning C4047: 'initializing' : 'char *' differs in levels of indirection from 'const int '
- 关于size_t 的warning C4267警告的解决
- Incompatible integer to pointer conversion initializing 'NSInteger *' (aka 'int *')
- Conversion to double from cell is not possible.
- warning C4305: 'initializing' : truncation from 'const double' to 'float'
- warning: deprecated conversion from string constant to ‘char的解决方法
- warning: deprecated conversion from string constant to ‘char*’
- warning: deprecated conversion from string constant to "char *"
- warning:deprecated conversion from string constant to 'char *'
- warning: deprecated conversion from string constant to 'char*'
- 【Python】Python3 List index()方法
- JSP/Servlet 工作原理
- 全志R16平台的Android6系统下调通rtl8189es
- android自定义Dialog
- 适配iOS11
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- 程序员的江湖,黑话一定要牢记
- Linux下使用FIO测试磁盘的IOPS
- iOS开发技巧之:图片压缩成指定的大小
- python解析json文件
- Android显示框架:Activity应用视图的创建流程
- JOB:基础知识
- Vue.js依赖收集
- 浅谈setTimeout,setInterval