[cfe-dev] casts.c, Windows issues

Daniel Dunbar daniel at zuster.org
Tue Aug 18 00:25:48 PDT 2009


On Mon, Aug 17, 2009 at 7:47 PM, John
Thompson<john.thompson.jtsoftware at gmail.com> wrote:
> 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.

This test should just be updated to not use that header, it shouldn't
be necessary.

> 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;

There is more to this, this makes the fields of MONITORINFO available
in this struct. The right fix is to implement this feature under
-fms-extensions. I think that this should be fairly easy, since we
already support the inline case:
--
struct {
  struct {
    int a;
  };
  int b;
} x;
--
just not:
--
struct s0 {
  int a;
};
struct {
  int b;
  struct s0;
} x;
--

> 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.

These defines should only be added on Windows, see
WindowsX86_32TargetInfo. Can you submit this part as a separate patch?

 - Daniel

> Hopefully, this is another step towards getting the Windows headers to compile.
>
> -John
>
> --
> John Thompson
> John.Thompson.JTSoftware at gmail.com
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>




More information about the cfe-dev mailing list