cvs commit: fptools/libraries/base/include HsBase.h

Sven Panne Sven.Panne at informatik.uni-muenchen.de
Sun Nov 2 17:32:13 EST 2003


Donald Bruce Stewart wrote:
>>From (OpenBSD) man sigfillset :
> 
>     sigemptyset() and sigfillset() are provided as macros, but actual
>     functions are available if their names are undefined (with #undef
>     name).
> 
> You want to use the function instead?

It's not their status as additional macros which causes trouble, but
the missing casts. From OpenBSD's <signal.h>:

#define sigemptyset(set)        (*(set) = 0, 0)
#define sigfillset(set)         (*(set) = ~(sigset_t)0, 0)

This is plainly wrong, set should be casted to sigset_t* (or a temp.
variable of that type should be used). Hugs' FFI uses void* for Haskell's
Ptr Foo, and dereferencing this causes trouble... Linux' headers are a
bit more careful here.

Cheers,
    S.




More information about the Cvs-libraries mailing list