I am trying to use Doxygen to document some C++ code that uses Microsoft's Source-Code Annotation Language (SAL). However, Doxygen does not parse certain annotation macros, like _Success_
, correctly. In the case of the example function annotation, _Success_
, Doxygen misinterprets this macro as the function header/prototype.
Take the following example that contains the function annotation marker:
/**
* @file
* Example with function annotation.
*/
#include <windows.h>
#include <sal.h>
/**
* @brief This is a function.
* @param i a random variable
* @return TRUE on every call.
*/
_Success_(return) // The SAL function annotation.
BOOL function(_In_ int i) {
return TRUE;
}
With the example above, Doxygen will interpret _Success_()
as the function header/prototype and thereby, creates documentation that is absolutely wrong. Here is what the HTML Doxygen output appears like with and without the function annotation:
With the function annotation, Doxygen also says I have documented a parameter variable i
that is not part of the list of arguments:
C:/.../Source.cpp:9: warning: argument 'i' of command @param is not found in the argument list of Success(return)
Am I missing a configuration setting in the main Doxygen configuration file?
Or is SAL and Doxygen simply just incompatible?