Fix a few GCC warnings

Authored by michalt on May 6 2018, 7:55 AM.



GCC 8 now generates warnings for incompatible function pointer casts
[-Werror=cast-function-type]. Apparently there are a few of those in rts
code, which makes ./validate unhappy (since we compile with -Werror)

This commit tries to fix these issues by changing the functions to have
the correct type (and, if necessary, moving the casts into those

For instance, hash/comparison function are declared (Hash.h) to take
StgWord but we want to use StgWord64[2] in StaticPtrTable.c.
Instead of casting the function pointers, we can cast the StgWord
parameter to StgWord*. I think this should be ok since StgWord
should be the same size as a pointer.

Signed-off-by: Michal Terepeta <>

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
michalt created this revision.May 6 2018, 7:55 AM
bgamari accepted this revision.May 6 2018, 11:33 PM

This looks right to me.


This revision is now accepted and ready to land.May 6 2018, 11:33 PM
This revision was automatically updated to reflect the committed changes.