[commit: ghc] master: Set proper `CTYPE` for POSIX `CGroup` (b9f636b)

git at git.haskell.org git at git.haskell.org
Sat Dec 6 17:10:38 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b9f636b3aa962154c1b1515a3acecfbe9071b308/ghc

>---------------------------------------------------------------

commit b9f636b3aa962154c1b1515a3acecfbe9071b308
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Dec 6 18:07:25 2014 +0100

    Set proper `CTYPE` for POSIX `CGroup`
    
    This fixes https://github.com/haskell/unix/issues/20 which is about
    compile warnings due to incompatible pointer types of the kind
    
         warning: passing argument 5 of ‘getgrnam_r’ from incompatible pointer type
         HsInt32 ghc...(void* a1, void* a2, void* a3, HsWord64 a4, void** a5)
           {return getgrnam_r(a1, a2, a3, a4, a5);}
    
         note: expected ‘struct group ** __restrict__’ but argument is of type ‘void **’
         extern int getgrnam_r (const char *__restrict __name,
    
    Signed-off-by: Herbert Valerio Riedel <hvr at gnu.org>


>---------------------------------------------------------------

b9f636b3aa962154c1b1515a3acecfbe9071b308
 libraries/base/System/Posix/Internals.hs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libraries/base/System/Posix/Internals.hs b/libraries/base/System/Posix/Internals.hs
index 30bf19c..c49e613 100644
--- a/libraries/base/System/Posix/Internals.hs
+++ b/libraries/base/System/Posix/Internals.hs
@@ -63,7 +63,7 @@ puts s = withCAStringLen (s ++ "\n") $ \(p, len) -> do
 -- Types
 
 type CFLock     = ()
-type CGroup     = ()
+data {-# CTYPE "struct group" #-} CGroup
 type CLconv     = ()
 type CPasswd    = ()
 type CSigaction = ()



More information about the ghc-commits mailing list