[cfe-dev] casts.c, Windows issues

John Thompson john.thompson.jtsoftware at gmail.com
Mon Aug 17 19:47:02 PDT 2009


I'm looking at the remaining failing tests under Windows.

Analysis/casts.c fails on trying to include syslog.h, which is not
present in the Visual Studio include files.  The enclosed patch is an
attempt to resolve that by conditionally including WinSock2.h instead,
and resolving issues related to problems including that header.

One issue is the need for the Windows Platform SDK to be added to the
default include paths.  This patch includes my former changes to the
default include paths for Windows, plus additional code for adding the
platform SDK.  Therefore, you can disregard my previous submissions
regarding InitHeaderSearch.cpp if you use this patch.  Also, if anyone
has a better mechanism of finding the Visual Studio and Platform SDK
includes, such as through the registry, please let me know.

A key issue I'll need some feedback on is that I'd like to downgrade
an error on member data declarations in a structure with no name to a
warning.  Unfortunately, WinUser.h has a couple of structures like
this:

typedef struct tagMONITORINFOEXA
{
    MONITORINFO;
    CHAR        szDevice[CCHDEVICENAME];
} MONITORINFOEXA, *LPMONITORINFOEXA;

Apparently, the nameless declaration is probably a placeholder for
data structure in common with multiple structures.  I've put in code
in the patch to check for this case in SemaDecl.cpp, and produce a
warning instead of an error.  However, I don't know if the way I did
it is sufficiently specific.  Doing so required changing two other
tests, SemaCXX/class.cpp and Sema/decl-invalid.c to accomodate the
message change.

The final key change is to add a couple of default macro definitions
in Targets.cpp to mimic Visual Studio's _M_IX86 and _M_AMD64, to avoid
#error directives in the Windows headers.

Hopefully, this is another step towards getting the Windows headers to compile.

-John

-- 
John Thompson
John.Thompson.JTSoftware at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: more_win32_stuff.patch
Type: application/octet-stream
Size: 6771 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090817/2d8996a0/attachment.obj>


More information about the cfe-dev mailing list