RE: SAL (was: RE:convert LARGE_INTEGER to DWORD)

Hmm. I haven’t tried this (nor completely thought it through), but given some function and struct declarations in a header file foo.h, it should be possible to annotate declarations in a separate header file (foo_sal.h) which is included at the *end* of foo.h.

In C, this should work quite well because duplicate declarations (not definitions) of functions and structs are permitted; the compiler will flag up cases where the declarations are not identical (C++ might think a mistake is an overload).

Yes, it means repeating declarations (and the maintenance overhead); but it’s compatible with the current SAL scheme, and there’s no need to change the code base for release. It does however assume at least two SAL compiler passes so that uses preceding foo_sal.h can be checked.

Maybe it would also be helpful to allow a visually-minimal SAL annotation (Fwd ?) for the ‘foo.h’ declarations which means ‘this declaration has a SAL version declared later’ so that if the compiler does *not* encounter such a version, it can complain. Non-SAL builds can use -D_Fwd_= .

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-582603-
xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: 13 May 2015 00:07
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] convert LARGE_INTEGER to DWORD

It would be an improvement for me if I could annotate my function
declarations outside of the file containing the function definitions.
I could then manage the complexity of the SAL stuff using the IDE to
connect the annotated declarations to the definitions. I could then
decouple the SAL annotations from the executing code and maintain
cross-platform development code bases.
This email message has been delivered safely and archived online by Mimecast.

For more information please visit http://www.mimecast.com