Skip to content

libraries/base/System/Posix/Types.hs: tries to define Floating instance for opaque type

I've noticed it as a build failure on openbsd-6 but on linux behaviour is strange as well.

Build failure:

libraries/base/System/Posix/Types.hs:217:100: error:
    * No instance for (Fractional Int32)
        arising from the 'deriving' clause of a data type declaration
      Possible fix:
        use a standalone 'deriving instance' declaration,
          so you can specify the instance context yourself
    * When deriving the instance for (Fractional CTimer)

On openbsd-6.0 timer_t is an int32:

# gcc -E /usr/include/time.h | grep timer_t                                                                                                                                                   
typedef __int32_t __timer_t;
typedef __timer_t timer_t;

On amd64-linux-glibc it's void*:

$ gcc -E /usr/include/time.h | grep timer_t
typedef void * __timer_t;
typedef __timer_t timer_t;

But base's configure detects it as Double (by chance) on amd64-linux-glibc.

System.Posix.Types> :t CTimer 
CTimer :: Double -> CTimer
Trac metadata
Trac field Value
Version 8.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information