Thread: MSVS 2012 SAL annotations

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    MSVS 2012 SAL annotations

    Does anyone use these cryptic things? I understand the reason for them but in my opinion they cause readability to suffer.

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    I would think - placing same definitions before the function in some way similar to C# attributes - and replacing at least partially the function comment - would be better and easier for other compilers to ignore them.

    Currently - I do not see this thing to be useful for somebody writing portable code... Or he will have to have a global include with conditional defines for all this additional garbage.

    Microsoft never thoughts about compatibility... Or maybe I'm wrong and they always think about new ways to break it.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    SAL is the successor to PREfast. Both of these technologies primarily exist in order for Microsoft to validate the correctness of their own code (Windows, mostly). PREfast, as well as the OACR monitor, were originally only available as part of the DDK/WDK. I do not know for sure, but I suspect that MS decided to make these technologies more public in the hope that somebody other than themselves could benefit from it.

    I didn't even know of the existence of MS static analysis until I started working on codebases that actually get checked in as part of Windows. Microsoft has some very stringent requirements on the code that gets built as part of Windows. I had to go through the process of understanding, then fixing, hundreds of different PREfast issues before our code could successfully merge into the Windows codebase.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 03-08-2013, 10:40 AM
  2. Germany: 2012
    By spaghetticode in forum General Discussions
    Replies: 3
    Last Post: 01-05-2012, 12:04 PM
  3. C++ Annotations
    By manasij7479 in forum Programming Book and Product Reviews
    Replies: 8
    Last Post: 11-30-2011, 12:12 PM
  4. 2012
    By Sebastiani in forum A Brief History of Cprogramming.com
    Replies: 57
    Last Post: 05-14-2009, 11:54 AM