[splint-discuss] RE: RE: A question about parsing windows.h (Visual Studio)

Daniel Nikolić Daniel.Nikolic at telefon-gradnja.hr
Fri May 19 07:32:23 EDT 2006


Thank you Michael!

I managed to ged rid of errors by using the 
following .splintc:

##### BEGIN .splintrc #####

-booltype BOOL

#naming

-globalprefix g_
+globalprefixexclude

#includes

-I.
-IC:\Progra~1\Micros~2.NET\Vc7\PlatformSDK\include
-IC:\Progra~1\Micros~2.NET\Vc7\include
#my includes ommited...

#Visual Studio .NET

-D_M_IX86=600
-DWIN32
-D_WIN32
-D_NTSYSTEM
-D_WIN32_WINNT=0x0500
-DWINVER=600
-DNOGDI
-DNOKERNEL
-DNOUSER
-DWIN32_LEAN_AND_MEAN
-D__int64=long
-D_int64=int
-D_wtoi=atoi
-DSTRICT
-D__try=
-D__except(x)=
-Dlint
-DGetExceptionCode()=1 

##### END .splintrc #####

Further, I had to comment out this in SDK (winnt.h):

#ifndef S_SPLINT_S // commented out to satisfy Splint

typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY {
    union {
        struct {
            DWORD NameOffset:31;
            DWORD NameIsString:1;
        };
        DWORD   Name;
        WORD    Id;
    };
    union {
        DWORD   OffsetToData;
        struct {
            DWORD   OffsetToDirectory:31;
            DWORD   DataIsDirectory:1;
        };
    };
} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY;

#endif // defined S_SPLINT_S

It is a structure containing two anonymous unions as 
members, and this confuses Splint, it seems.

Because I turned on WIN32_LEAN_AND_MEAN in .splintc,
I had to modify windows.h to include winsock.h always.

One can go further and annotate Windows API (I put 
/*@out@*/ in GetCurrentTime()), etc.

Well, thank you very much for your help; if I find 
more ways to get splint to be useful with Windows, 
I'll post to the forum!

Daniel Nikolic



More information about the splint-discuss mailing list