[GHC] #12998: libraries/base/System/Posix/Types.hs: tries to define Floating instance for opaque type

GHC ghc-devs at haskell.org
Sun Jan 15 16:56:05 UTC 2017


#12998: libraries/base/System/Posix/Types.hs: tries to define Floating instance for
opaque type
-------------------------------------+-------------------------------------
        Reporter:  slyfox            |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.2.1
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12795            |  Differential Rev(s):  Phab:D2876,
       Wiki Page:                    |  Phab:D2952
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"db91d17edfbe7deecb62bbb89c804249f9c4a4bd/ghc"
 db91d17e/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="db91d17edfbe7deecb62bbb89c804249f9c4a4bd"
 Properly introduce CTimer to System.Posix.Types

 Summary:
 In ffc2327070dbb664bdb407a804121eacb2a7c734, an attempt was made at
 adding a Haskell wrapper around the C `timer_t` type. Unfortunately, GHC's
 autoconf macros weren't sophisticated enough at the time to properly
 detect
 that `timer_t` is represented by a `void *` (i.e., a pointer) on most
 OSes.

 This is a second attempt at `CTimer`, this time using `AC_COMPILE_IFELSE`
 to
 detect if a type is a pointer type by compiling the following program:

 ```
 type val;
 *val;
 ```

 This also only derives a small subset of class instances for `CTimer` that
 are
 known to be compatible with `Ptr` using a new `OPAQUE_TYPE_WITH_CTYPE`
 macro.

 Test Plan: ./validate

 Reviewers: erikd, hvr, austin, bgamari

 Reviewed By: bgamari

 Subscribers: thomie

 Differential Revision: https://phabricator.haskell.org/D2952

 GHC Trac Issues: #12795, #12998
 }}}

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


More information about the ghc-tickets mailing list