本文介绍了我们应该使用 _In_ 而不是 __in 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我今天阅读了 VS2010 中的 sal.h.
我有点惊讶.
I read sal.h, which is in VS2010, today.
I was a little surprised.
// This section contains the deprecated annotations
|------------|------------|---------|--------|----------|----------|---------------|
| Level | Usage | Size | Output | NullTerm | Optional | Parameters |
|------------|------------|---------|--------|----------|----------|---------------|
| <> | <> | <> | <> | _z | <> | <> |
| _deref | _in | _ecount | _full | _nz | _opt | (size) |
| _deref_opt | _out | _bcount | _part | | | (size,length) |
| | _inout | | | | | |
| | | | | | | |
|------------|------------|---------|--------|----------|----------|---------------|
我一直使用这些注释.
我无法相信它们已被弃用.是真的吗?
如果是,为什么?
从现在开始我们应该使用以下注释吗?-我不熟悉:(
I always used these annotations.
I can't believe that they are deprecated. Is it true?
If so, why?
Should we use following annotations from now on? -It's not familiar to me :(
|--------------|----------|----------------|-----------------------------|
| Usage | Nullness | ZeroTerminated | Extent |
|--------------|----------|----------------|-----------------------------|
| _In_ | <> | <> | <> |
| _Out_ | opt_ | z_ | [byte]cap_[c_|x_]( size ) |
| _Inout_ | | | [byte]count_[c_|x_]( size ) |
| _Deref_out_ | | | ptrdiff_cap_( ptr ) |
|--------------| | | ptrdiff_count_( ptr ) |
| _Ret_ | | | |
| _Deref_ret_ | | | |
|--------------| | | |
| _Pre_ | | | |
| _Post_ | | | |
| _Deref_pre_ | | | |
| _Deref_post_ | | | |
|--------------|----------|----------------|-----------------------------|
顺便说一下,SO 中不存在 SAL 标签.
如果可以,请制作它.
By the way, SAL tag doesn't exist in SO.
Please make it, if you could.
推荐答案
看来你应该习惯新的属性"SAL 格式了,看这篇文章中间的红色评论:
It seems that you should getting used to the new "attribute" SAL format, see the comment in red in the middle of this post:
http://blogs.msdn.com/b/michael_howard/archive/2006/05/19/602077.aspx
这篇关于我们应该使用 _In_ 而不是 __in 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!