[Haskell-cafe] Compiling with hsc2hs and -Wextra

Niklas Hambüchen mail at nh2.me
Thu Nov 8 01:54:33 CET 2012


Hi,

when I compile my C binding using hsc2hs with the -Wextra enabled in my
cabal file:

    cc-options: -std=c99 -Wall -Wextra -Werror

This breaks the compilation started by hsc2hs:

    MyHsc.hsc: In function ‘main’:
    MyHsc.hsc:16:15: error: unused parameter ‘argc’
[-Werror=unused-parameter]
    MyHsc.hsc:16:27: error: unused parameter ‘argv’
[-Werror=unused-parameter]
    cc1: all warnings being treated as errors
    compiling dist/build/MyHsc_hsc_make.c failed (exit code 1)

I would really like to compile my code with -Wextra -Werror though.

Can't we just (void) argc; (void) argv; the arguments in the generated
code, like described in [1]?

Thanks
Niklas


[1]
http://stackoverflow.com/questions/3599160/unused-parameter-warnings-in-c-code



More information about the Haskell-Cafe mailing list