Should we use _In_ instead of __in?

0

Issue

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_ |          |                |                             |
|--------------|----------|----------------|-----------------------------|

By the way, SAL tag doesn’t exist in SO.
Please make it, if you could.

Solution

It seems that you should getting used to the new "attribute" SAL format, see the comment in red in the middle of this post:

Link

Answered By – Alberto Martinez

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More