From: Simon Peyton-Jones <simo...@microsoft.com>
To: "Edward Z. Yang" <ezy...@mit.edu>, Simon Marlow
        <marlo...@gmail.com>
Cc: "ghc-devs@haskell.org" <ghc-devs@haskell.org>
Subject: RE: More windows woe
Message-ID:
        
<59543203684b2244980d7e4057d5fbc1485bb...@db3ex14mbxc308.europe.corp.microsoft.com>
        
Content-Type: text/plain; charset="utf-8"

Simon Marlow: please help!
At the moment windows builds are hosed, which is a Bad Situation.

Actually it turns out that what want is

   debugBelch("Checking whether to unload %S\n", oc->fileName));

That is, use "%S" rather than "%s" as format specifier for wide chars.

Sadly, this works on Windows, but not on Linux:
rts/CheckUnload.c:260:13:
      error: format ?%S? expects argument of type ?wchar_t *?, but argument 2 
has type ?pathchar *? [-Werror=format]


So what I need guidance on, please!, is what the approved way to deal with this 
is.  I suppose that I could identify each use of %s on a filepath and say

#ifdef mingw32_HOST_OS
   debugBelch("Checking whether to unload %S\n", oc->fileName));
#else
   debugBelch("Checking whether to unload %s\n", oc->fileName));
#endif

But that seems deeply unsatisfactory doesn't it?

If not that, then what?


Simon

Similar code is in place to distinguish between 32-bit and 64-bit StgWords:

> grep -r -e FMT_Word includes/
includes/stg/Types.h:#define FMT_Word32    "u"
includes/stg/Types.h:#define FMT_Word32    "lu"
includes/stg/Types.h:#define FMT_Word64    "lu"
includes/stg/Types.h:#define FMT_Word64    "llu"
includes/stg/Types.h:#define FMT_Word     FMT_Word64
includes/stg/Types.h:#define FMT_Word     FMT_Word32

and format strings like "blabla " FMT_Word " ..blabla" are used inside rts/. One could do the same for FMT_Path and introduce it where required.

Maybe this would be acceptable?

/ Jost


_______________________________________________
ghc-devs mailing list
ghc-devs@haskell.org
http://www.haskell.org/mailman/listinfo/ghc-devs

Reply via email to