On 20 March 2011 13:41, denis campredon wrote:
> downloaded gcc 4.6, and tried it.
>
> And I found something a little strange when I compile a file :
>
> g++ displayboard.cpp -lncurses -c
> displayboard.cpp: In constructor ‘DisplayBoard::DisplayBoard(int, int)’:
> displayboard.cpp:47:22: error: invalid conversion from ‘void (*
> (*)())(int)’ to ‘sighandler_t’ [-fpermissive]
> displayboard.cpp:41:16: error:   initializing argument 2 of ‘void (*
> signal(int, sighandler_t))(int)’ [-fpermissive]
>
>
> So, I tried to compile with the flag suggested
>
>
> g++ displayboard.cpp -lncurses -c -fpermissive
> displayboard.cpp: In constructor ‘DisplayBoard::DisplayBoard(int, int)’:
> displayboard.cpp:47:22: warning: invalid conversion from ‘void (*
> (*)())(int)’ to ‘sighandler_t’ [-fpermissive]
> displayboard.cpp:41:16: warning:   initializing argument 2 of ‘void (*
> signal(int, sighandler_t))(int)’ [-fpermissive]
>
>
>
> So I was wondering if it was normal to gcc to suggest the same flag,
> who can't change the output for the second case.

This mailing list is for discussing development of gcc, not help using
gcc. Please take any further questions to the gcc-h...@gcc.gnu.org
mailing list, thanks.

Yes, it's normal.  The [-fpermissive] annotation on the warning tells
you which flag controls the warning, it isn't telling you that using
the flag will make the warning go away.  Using the flag downgraded the
diagnostic from an error to a warning.

Compare it with other diagnostic output e.g.

warning: comparison between signed and unsigned integer expressions
[-Wsign-compare]

This tells you the diagnostic is controlled by the -Wsign-compare
option, not that adding -Wsign-compare will make the warning go away.

Reply via email to