[GHC] #12890: Stdcall - treating as CCall (bogus warning on win 64 bit)

GHC ghc-devs at haskell.org
Mon Nov 28 17:30:38 UTC 2016


#12890: Stdcall - treating as CCall (bogus warning on win 64 bit)
-------------------------------------+-------------------------------------
           Reporter:  tim-m89        |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Windows
       Architecture:  x86_64         |   Type of failure:  Incorrect
  (amd64)                            |  error/warning at compile-time
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 On windows you generally have the stdcall calling convention so you're
 average foreign import looks like this:

 {{{
 foreign import stdcall "someFile.h getFoo" getFoo :: IO Foo
 }}}

 But on a 64 bit system, GHC warns:


 {{{
 C:\Some\Path.hs:35:1: warning: [-Wunsupported-calling-conventions]
     * the 'stdcall' calling convention is unsupported on this platform,
 treating as ccall
     * When checking declaration:
         foreign import stdcall safe "static someFile.h getFoo" getFoo ::
 IO Foo
 }}}

 Both stdcall & ccall are not applicable to a 64 bit system as far as I
 know, and if it was really treating it as ccall it would have segfaulted
 at runtime. So the warning is a bit of a lie anyway.

 So far some developers generally have resorted to creating c preprocessor
 macros like this: [https://www.mail-archive.com/cvs-
 libraries at haskell.org/msg09725.html]

 Apologies if this is a dupe, I thought someone already reported this a
 long time ago but I can't seem to find the ticket.

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


More information about the ghc-tickets mailing list