Niklas Hambüchen | 8 Nov 01:54 2012

Compiling with hsc2hs and -Wextra

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

Gmane