Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Document Method Should Ignore _Use_decl_annoations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

[email protected]
New Member

USA
7 Posts

Posted - Jul 31 2015 :  11:18:16 AM  Show Profile  Reply with Quote
The Refactor... Document Method feature is terrific. However, in parsing and filling-in the RETURNS value, it does not know to ignore the compiler declaration "_Use_decl_annotations" preceding a method's return type. This is used with SAL Annotations to indicate that the implementation should use the annotations that are present in the header.

For example:

_Use_decl_annotations_
VOID
FooResetUartWorker(WDFWORKITEM WorkItem)
{
// Function body here
}

When you select the method name, and tell VAX to Document Method, if your method template includes return values, the string _Use_decl_annotations_ winds-up in the documentation, and the "VOID" ends up on a line by itself as follows:

///////////////////////////////////////////////////////////////////////////////
//
// FooResetUartWorker
//
//
// INPUTS:
//
// WorkItem
//
//
// OUTPUTS:
//
// None.
//
// RETURNS:
//
// _Use_decl_annotations_
VOID
//
///////////////////////////////////////////////////////////////////////////////

This isn't a tragedy, but it *does* cause VS 2013 to parse the "VOID", and start marking everything following as an error. Which causes VS to hang for a few seconds, before you can go in and fix the formatting.

It seems that Document Method knows to ignore things like "__forceinline"... with the increased emphasis Microsoft is placing on SAL Annotations, and their increasing acceptance, it would be *very* helpful if Document Method could ignore these annotations as well.

Of course, the whole topic of VAX understanding SAL Annotations themselves (and ignoring them in method declarations) is a separate issue. It would be nice if the annotations themselves were understood and skipped over. But it would *really* be a big help if the _Use_decl_annotations_ at least was ignored.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Aug 07 2015 :  11:29:49 AM  Show Profile  Reply with Quote
I am seeing the same effect here, thank you for the clear description:

case=84805

For now, as a (clunky) workaround, putting VOID and _Use_decl_annotations_ on the same line would not result in a compiler error.
Go to Top of Page

[email protected]
New Member

USA
7 Posts

Posted - Aug 07 2015 :  11:32:00 AM  Show Profile  Reply with Quote
Thank you for the very considerate answer to what is, I'm sure, a rather unique problem.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000