Author |
Topic |
|
[email protected]
New Member
USA
7 Posts |
Posted - Jul 31 2015 : 11:18:16 AM
|
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
|
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. |
|
|
[email protected]
New Member
USA
7 Posts |
Posted - Aug 07 2015 : 11:32:00 AM
|
Thank you for the very considerate answer to what is, I'm sure, a rather unique problem. |
|
|
|
Topic |
|
|
|