Strange SAL Annotation Warning

I am trying to use the Micosoft SAL annotation for my project, however I get the following warning and I don't know why.

As an example, I created a new C ++ console application and got this code:

#include <sal.h>

class Whatever
{
public:
    _Check_return_ int Method(__in int number) ;
};

int main()
{
    return 0;
}

When I compile using Visual Studio 2008, I get the following warning:

warning C6540: using attribute annotations for this function will invalidate all existing __declspec annotations

In the file "c1xxast"

What am I doing wrong? If I delete either _Check_return_, or __in, the warning will disappear.

I can not find the link to warning C6550. However, the same text can be found here: http://msdn.microsoft.com/en-us/library/dd445322.aspx , but this is not very useful.

+3
2

, SAL. , MSDN , SAL: ... er... not.

#define <sal.h> VC2005 , . VC2008 ( ) , capital.

:

  • _ _
  • _Check_return _

Non-:

  • __
  • __ checkReturn

, .

.

+10

SAL , . , SAL , .

SAL . SAL . , .

+1

Source: https://habr.com/ru/post/1704868/


All Articles