来自最新MS编译器的有趣警告 [英] Interesting warnings from latest MS compiler

查看:97
本文介绍了来自最新MS编译器的有趣警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最新的MS编译器depricates某些功能包括

stricmp。函数stricmp不是C ++标准的一部分,它是POSIX的一部分。我有这个问题,为了符合C ++

标准,为了符合C ++

标准,为了让MS符合这个名称,为了符合C ++

标准,这对于MS来说是非常不可靠的吗?

The latest MS compiler "depricates" certain functions including
stricmp. The function stricmp is not part of the C++ standard, it is
part of POSIX. The question I have, is it really necissary for MS to
move from that name to _stricmp in order to be compliant with the C++
standard?

推荐答案

Noah Roberts写道:
Noah Roberts wrote:
最新的MS编译器depricates某些功能包括stricmp。函数stricmp不是C ++标准的一部分,它是POSIX的一部分。我的问题是,为了符合C ++
标准,MS为了符合C ++
标准而将其从名称转移到_stricmp真是不可能吗?
The latest MS compiler "depricates" certain functions including
stricmp. The function stricmp is not part of the C++ standard, it is
part of POSIX. The question I have, is it really necissary for MS to
move from that name to _stricmp in order to be compliant with the C++
standard?




这不是合法的弃用。这是因为MS编程人员不知道他们有能力避免允许未经检查的缓冲区溢出。所以MS

现在将所有未经检查的缓冲区功能标记为已弃用。


作为问题的一个例子,我的家用计算机上有一个精简的Web服务器。

每隔一段时间,用一个包含几个

百个填充字符,00000000000或其他东西的URL来点击它,然后一点点

代码。


恶意软件,正在某个地方,正在探测已知服务器中的已知错误。 (不是_my_

服务器,谢谢!)因此,所有这些安全问题的主要原因是在低级代码中未经检查的缓冲区处理。所以使用fgets()代替

gets(),并使用snprintf()而不是sprintf()。


而且,哎呀,使用std :: gosh's s的字串!!!


Phlip
http://c2.com/cgi/wiki?ZeekLand < - 不是博客!!!



That''s not legal deprecation. It''s because MS programmers are not known for
their ability to refrain from permitting unchecked buffer overruns. So MS
now marks all the unchecked buffer functions as deprecated.

As an example of the problem, I have a lite web server on my home computer.
Every once in a while, something hits it with an URL containing a couple
hundred pad characters, 00000000000 or something, and then a little bit of
code.

Malware, somewhere, is probing for a known bug in a known server. (Not _my_
server, thank you!) So the main cause of all these security issues is
unchecked buffer handling in low-level code. So use fgets() instead of
gets(), and use snprintf() instead of sprintf().

And, heck, use std::string for gosh''s sakes!!!

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!


Noah Roberts写道:
Noah Roberts wrote:
最新的MS编译器depricates某些功能包括stricmp。函数stricmp不是C ++标准的一部分,它是POSIX的一部分。我的问题是,为了符合C ++
标准,MS为了符合C ++
标准而将其从名称转移到_stricmp真是不可能吗?
The latest MS compiler "depricates" certain functions including
stricmp. The function stricmp is not part of the C++ standard, it is
part of POSIX. The question I have, is it really necissary for MS to
move from that name to _stricmp in order to be compliant with the C++
standard?




不是所有以str开头的标识符由C89保留(和

因此是C ++)?



aren''t all identifiers starting with "str" reserved by C89 (and
therefore C++)?


Noah Roberts写道:
Noah Roberts wrote:
最新的MS编译器" depricates"某些功能包括stricmp。函数stricmp不是C ++标准的一部分,它是POSIX的一部分。我的问题是,为了符合C ++
标准,MS为了符合C ++
标准而将其从名称转移到_stricmp真是不可能吗?
The latest MS compiler "depricates" certain functions including
stricmp. The function stricmp is not part of the C++ standard, it is
part of POSIX. The question I have, is it really necissary for MS to
move from that name to _stricmp in order to be compliant with the C++
standard?




stricmp不是POSIX。虽然POSIX有strcasecmp。



stricmp is not POSIX. POSIX has strcasecmp though.


这篇关于来自最新MS编译器的有趣警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆