[GHC] #9726: Linker.c uses of swprintf() fail to compile on gcc 4.8.3

GHC ghc-devs at haskell.org
Sat Oct 25 21:21:34 UTC 2014


#9726: Linker.c uses of swprintf() fail to compile on gcc 4.8.3
-------------------------------------+-------------------------------------
       Reporter:  gintas             |                   Owner:  gintas
           Type:  bug                |                  Status:  new
       Priority:  normal             |               Milestone:
      Component:  Runtime System     |                 Version:  7.9
       Keywords:                     |        Operating System:  Windows
   Architecture:  Unknown/Multiple   |         Type of failure:
     Difficulty:  Unknown            |  None/Unknown
     Blocked By:                     |               Test Case:
Related Tickets:                     |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------
 swprintf has different signatures in mingw32, where it does not include
 the
 buffer size, and in mingw-w64, where it does. That of course breaks the
 code
 as mingw-w64 treats the pointer to the format string as a size_t. Bummer:


 C:/.../inplace/mingw/i686-w64-mingw32/include/swprintf.inl:30:5: note:
 expected 'size_t' but argument is of type 'short unsigned int *'
  int swprintf (wchar_t *__stream, size_t __count, const wchar_t *__format,
 ...)
      ^

 rts\Linker.c:1986:12:
      warning: passing argument 2 of 'swprintf' makes integer from pointer
 without a cast [enabled by default]
                 swprintf(buf, L"lib%s.DLL", dll_name);

 I have a fix pending to use snwprintf instead.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9726>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list