是时候摆脱未签名? [英] time to get rid of unsigned?

查看:74
本文介绍了是时候摆脱未签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道无符号整数数据类型是造成大多数b / b
虚假警告信息的原因,但我并没有意识到它们是一个安全

风险(参见此处
http:// www .securitytracker.com /警报... / 1009067.html)。全部为一个

可能会多加一点。


那么C ++是否有时间弃用无符号整数类型?


john

I knew that unsigned integral data types were the cause of scads of mostly
spurious warning messages, but I didn''t realise that they were a security
risk too (see here
http://www.securitytracker.com/alert.../1009067.html). All for one
measly extra bit.

So has the time come for C++ to deprecate unsigned integral types?

john

推荐答案



" John Harrison" <乔************* @ hotmail.com>在消息新闻中写道:c0 ************* @ ID-196037.news.uni-berlin.de ...

"John Harrison" <jo*************@hotmail.com> wrote in message news:c0*************@ID-196037.news.uni-berlin.de...
我知道无符号整数数据类型是scads的原因主要是虚假的警告信息,但我并没有意识到它们也是一种安全风险(见这里
http://www.securitytracker.com/alert.../1009067.html) 。所有这一切都非常有用。

那么C ++是否还有时间来弃用无符号整数类型?
I knew that unsigned integral data types were the cause of scads of mostly
spurious warning messages, but I didn''t realise that they were a security
risk too (see here
http://www.securitytracker.com/alert.../1009067.html). All for one
measly extra bit.

So has the time come for C++ to deprecate unsigned integral types?




实际上它看起来只是相反的问题。如果计算是

全部未签名,则不会有问题。



Actually it looks like just the opposite problem. If the calculation was
all unsigned, it wouldn''t be a problem.


" John Harrison" <乔************* @ hotmail.com>写了
"John Harrison" <jo*************@hotmail.com> wrote
我知道无符号整数数据类型是大多数虚假警告信息的原因,但我并没有意识到它们也是一种安全风险(请参阅此处
http://www.securitytracker .COM /警报... / 1009067.html)。所有这一切都非常有用。

那么C ++是否还有时间来弃用无符号整数类型?
I knew that unsigned integral data types were the cause of scads of mostly
spurious warning messages, but I didn''t realise that they were a security
risk too (see here
http://www.securitytracker.com/alert.../1009067.html). All for one
measly extra bit.

So has the time come for C++ to deprecate unsigned integral types?




你不要不要弃用功能,因为有些人太不能使用它们

正确。如果你这样做了,你也会删除指针,引用,副作用和

别名等等,最后会得到一种完全不同的语言,这可能会让你看起来像b $ b。很像ML。 C ++是一种电动工具,需要与

适当的谨慎和培训一起使用。任何编程错误都是

程序员的错,而不是语言。


Claudio Puviani



You don''t deprecate features because some people are too incompetent to use them
correctly. If you did, you''d also remove pointers, references, side-effects and
aliasing, etc. and end up with a completely different language that would
probably look a lot like ML. C++ is a power tool and needs to be used with the
appropriate caution and training. Any programming error is the fault of the
programmer, not the language.

Claudio Puviani




" Ron Natalie" < ro*@sensor.com>在消息中写道

news:40 ********************* @ news.newshosting.com。 ..

"Ron Natalie" <ro*@sensor.com> wrote in message
news:40*********************@news.newshosting.com. ..

John Harrison <乔************* @ hotmail.com>在消息中写道

"John Harrison" <jo*************@hotmail.com> wrote in message



news:c0 ************* @ ID-196037.news.uni-berlin.de ...


news:c0*************@ID-196037.news.uni-berlin.de...

我知道无符号整数数据类型是导致
大部分虚假警告消息的原因,但我没有意识到它们是
安全性也是风险(见这里
http:// www.securitytracker.com/alert.../1009067.html)。所有这些都是
一个可怜的额外位。

那么C ++是否还有时间来弃用无符号整数类型?
I knew that unsigned integral data types were the cause of scads of mostly spurious warning messages, but I didn''t realise that they were a security risk too (see here
http://www.securitytracker.com/alert.../1009067.html). All for one measly extra bit.

So has the time come for C++ to deprecate unsigned integral types?



实际上它看起来就像是相反的问题。如果计算结果全部未签名,则不会有问题。



Actually it looks like just the opposite problem. If the calculation was
all unsigned, it wouldn''t be a problem.




如果全部是int,那么它也不是问题,问题是

两者的混合以及可能导致的溢出。由于我不认为有人建议删除已签名的整数,所以我建议我们放弃

无符号。除了字符类型外。


john



If it was all int it wouldn''t be an issue either, the problem is the mix of
the two and the overflows that can result. Since I don''t guess anyone is
proposing to remove signed integers, I''m proposing that we should drop
unsigned. Except maybe for character types.

john


这篇关于是时候摆脱未签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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