vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
来源:互联网 发布:工程网络计划紧前工作 编辑:程序博客网 时间:2024/05/29 10:08
查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,设置成否
阅读全文
1 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*'
- 关于如何通过apktool获取apk package name(包名)以及activity name
- Linux system temp
- 调试远程tomcat服务器
- 1.3为什么要用框架开发
- 练习54
- vs2005 warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data
- C#泛型介绍
- java使用POI设置单元格内容下拉框选择和单元格提示功能
- Android7.0中文API --- ImageView
- jzoj P1843【汕头市选2014】小球
- python2.6版本升级为2.7(不知名网站copy,经过修改本人亲测可用)
- 两种输出调试信息的方法
- DIV+CSS
- Java实现二分查找的递归算法