使用 VS 2003 构建的用于生成 32 位二进制文件的代码在构建时没有发出任何警告。
相同的代码,没有一个单一的代码更改,编译和链接使用 Visual Studio 2010 编译器成功生成 64 位二进制但具有以下警告列表。
所以,我的问题是,下面列表中的任何警告是否在运行时引起关注?
pcd.c(248) : warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
pcd.c(377) : warning C4244: '=' : conversion from 'uintptr_t' to 'ULONG', possible loss of data
pcd.c(236) : warning C4100: 'argv' : unreferenced formal parameter
i.c(183) : warning C4100: 'lpReserved' : unreferenced formal parameter
api.c(506) : warning C4996: 'stricmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _stricmp. See online help for details.
api.c(554) : warning C4310: cast truncates constant value
api.c(719) : warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
api.c(2217) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
api.c(2892) : warning C4312: 'type cast' : conversion from 'ULONG_T' to 'HANDLE_T' of greater size
api.c(559) : warning C4702: unreachable code
stdio.h(234) : see declaration of 'fopen'
api.c(2217) : warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
prm.c(681) : warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\stdio.h(234) : see declaration of 'fopen'
host.c(410) : warning C4311: 'type cast' : pointer truncation from 'PVOID_T' to 'unsigned long'
stub.c(138) : warning C4295: 'eye' : array is too small to include a terminating null character
isv.c(372) : warning C4310: cast truncates constant value
chp.c(250) : warning C4244: '=' : conversion from 'SOCKET' to 'ULONG_T', possible loss of data
api.c(665) : warning C4311: 'type cast' : pointer truncation from 'HANDLE_T' to 'LONG'
api.c(1216) : warning C4057: 'function' : 'LPDWORD' differs in indirection to slightly different base types from 'LONG_T *'
hlp.c(1171) : warning C4057: 'function' : 'LPDWORD' differs in indirection to slightly different base types from 'LONG_T *'
neto.c(435) : warning C4057: 'function' : 'PLONG_T' differs in indirection to slightly different base types from 'ULONG_T *'
neto.c(595) : warning C4152: nonstandard extension, function/data pointer conversion in expression
neto.c(2115) : warning C4213: nonstandard extension used : cast on l-value
neto.c(2209) : warning C4057: 'function' : 'int *' differs in indirection to slightly different base types from 'LONG *'
td.c(760) : warning C4244: '=' : conversion from 'uintptr_t' to 'int', possible loss of data
td.c(2104) : warning C4054: 'type cast' : from function pointer 'FARPROC' to data pointer 'PVOID'
msc.c(287) : warning C4133: 'function' : incompatible types - from 'long *' to 'time_t *'
msc.c(1009) : warning C4702: unreachable code
inf.c(400) : warning C4057: 'function' : 'PLONG_T' differs in indirection to slightly different base types from 'ULONG *'
arb.c(166) : warning C4267: '=' : conversion from 'size_t' to 'LONG_T', possible loss of data
arb.c(226) : warning C4244: '=' : conversion from 'int' to 'CHAR_T', possible loss of data
sl.c(441) : warning C4054: 'type cast' : from function pointer 'int (__cdecl *)(unsigned char *,int,int,void *)' to data pointer 'void *'
pco.c(369) : warning C4057: 'function' : 'PLONG_T' differs in indirection to slightly different base types from 'ULONG_T *'
exit1.c(157) : warning C4295: 'publickey' : array is too small to include a terminating null
env.c(341) : warning C4267: 'function' : conversion from 'size_t' to 'DWORD', possible loss of data
hook.c(221) : warning C4245: 'return' : conversion from 'int' to 'SOCKET', signed/unsigned mismatch
hook.c(817) : warning C4311: 'type cast' : pointer truncation from 'unsigned char *' to 'int'
tor.c(128) : warning C4244: 'function' : conversion from 'time_t' to 'unsigned int', possible loss of data
cth.c(1012) : warning C4244: '=' : conversion from '__int64' to 'int', possible loss of data
cntrl.c(427) : warning C4996: 'strnicmp': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _strnicmp. See online help for details.
api.c(263) : warning C4057: 'function' : 'int *' differs in indirection to slightly different base types from 'LONG_T *'
api.c(706) : warning C4057: 'function' : 'int *' differs in indirection to slightly different base types from 'DWORD *'
ii.c(252) : warning C4244: '=' : conversion from 'time_t' to 'long', possible loss of data
谢谢