none
typedef _W64 unsigned int uintptr_t -> C2632 int followed by int illegal

    Question

  • This is hopefully something simple but I've hit a blocker on it.

    I'm porting a very old application to using MS VC++ 2008 with WKD 7.0.1. I'm getting an old compiler error on one of the files. This file is compiled twice, onces as a kernel driver which compiles no problem and once as a DLL which is where the error is thrown. I suspect I am missing some pre-processing directive but unsure what.

    Broken :

    cl /c /nologo /D_WIN32 /D_WIN32_WINNT=0x0500 /I./include /D_NT /D
    _WINDOWS /MD /D_USRDLL /showIncludes /DUEXC_LOGNAME=\"C:\\\\Progra~1\\\\
    \\\\user.log\" -Di386=1 -D_X86_=1 -Ii386 /Folib/NT/i386/user/MYCODE.o src/MYCODE.c
    MYCODE.c
    Note: including file:   C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\windows.h
    Note: including file:    C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include\sdkddkver.h
    Note: including file:    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\excpt.h
    Note: including file:     C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\crtdefs.h
    Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\sal.h
    Note: including file:       c:\program files\microsoft visual studio 9.0\ vc\include\codeanalysis\sourceannotations.h
    Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\crtassem.h
    Note: including file:      C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\vadefs.h
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\vadefs.h(52) : warning C
    4114: same type qualifier used more than once
    C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\vadefs.h(52) : error C26
    32: 'int' followed by 'int' is illegal

    Works :

    cl /c /nologo /D_WIN32 /D_WIN32_WINNT=0x0500 /I./include -I./NT/bsd/include -I./NT/util/include -I./NT/driver/include -Ic:\\WinDDK\\7600.16385.1/
    inc/api -Ic:\\WinDDK\\7600.16385.1/inc/ddk -DFPO=1 /Oxs /Oy /GS- -FIc:\\WinDDK\\
    7600.16385.1/inc/api/warning.h -Di386=1 -D_X86_=1 -Ii386 -DSTD_CALL -DCONDITION_
    HANDLING=1 -DNDIS40=1 -DNT_UP=1  -DNT_INST=0 -DWIN32=100 -D_NT1X_=100 -DWINNT=1
    -D_WIN32_WINNT=0x0500 -DWINVER=0x0500 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN=1 -DDEVL=1 -DNDEBUG -D_IDWBUILD -Zp8 -Gy -W3 -Gz -Gm- -EHs-c- -GR- -GF  -I./NT/bsd/include -I./NT/driver/include /Folib/NT/i386/ndis/MYCODE.o src/MYCODE.c
    MYCODE.c

     

    vadefs.h line 52

    typedef _W64 unsigned int   uintptr_t;   <---_W64 should be null cause not defining 64b


    Betsy
    Monday, August 22, 2011 1:15 AM

Answers

  • Combining SDK/VS/WDK include files is an absolute nightmare and should be completely avoided. The WDK include files are generally sufficient for building win32 console or MFC/ATL apps as long as you can live with obsolete versions of MFC and ATL.

     

    Build using the WDK toolchain, with a SOURCES file etc. You can integrate a WDK "project" into the VS build system using the "ddkbuild" external makefile method - see my website for details, www.hollistech.com.

    This is probably not the answer you wanted to read, but this is the approach that will work and be maintainable, unlike the current method you are using.


    Mark Roddy Windows Driver and OS consultant www.hollistech.com
    Tuesday, August 23, 2011 4:29 PM
    Moderator
  • [snip]

    vadefs.h line 52

    typedef _W64 unsigned int   uintptr_t;   <---_W64 should be null cause not defining 64b

    No,  _W64 does not mean a 64 bit build. In some previous VC++ or Platform SDK versions it was an attribute to mark variables that change size when compiled for 64 bits; it worked together with /W64 compiler switch. See: http://msdn.microsoft.com/en-us/library/s04b5w00.aspx

    This was useful to test legacy 32-bit code for portability. New compilers (VC 2008+ or WDK 6000+) do not seem to use/support this attribute nor /W64 switch. Somewhere in WDK headers it is still defined as nothing, but not in VC++2008 or newer SDK.

    Regards,

    -- pa


    Wednesday, August 24, 2011 2:47 AM

All replies

  • Hi Betsy,

     

    I think your issue should be raised in the Windows WDK and Driver Development Forum. I believe they will know more information of this issue than us, and I will move this one to that forum.

     

    Thanks for your understanding,

     

    Best regards,

    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 23, 2011 2:27 AM
  • Combining SDK/VS/WDK include files is an absolute nightmare and should be completely avoided. The WDK include files are generally sufficient for building win32 console or MFC/ATL apps as long as you can live with obsolete versions of MFC and ATL.

     

    Build using the WDK toolchain, with a SOURCES file etc. You can integrate a WDK "project" into the VS build system using the "ddkbuild" external makefile method - see my website for details, www.hollistech.com.

    This is probably not the answer you wanted to read, but this is the approach that will work and be maintainable, unlike the current method you are using.


    Mark Roddy Windows Driver and OS consultant www.hollistech.com
    Tuesday, August 23, 2011 4:29 PM
    Moderator
  • [snip]

    vadefs.h line 52

    typedef _W64 unsigned int   uintptr_t;   <---_W64 should be null cause not defining 64b

    No,  _W64 does not mean a 64 bit build. In some previous VC++ or Platform SDK versions it was an attribute to mark variables that change size when compiled for 64 bits; it worked together with /W64 compiler switch. See: http://msdn.microsoft.com/en-us/library/s04b5w00.aspx

    This was useful to test legacy 32-bit code for portability. New compilers (VC 2008+ or WDK 6000+) do not seem to use/support this attribute nor /W64 switch. Somewhere in WDK headers it is still defined as nothing, but not in VC++2008 or newer SDK.

    Regards,

    -- pa


    Wednesday, August 24, 2011 2:47 AM