From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23391 invoked by alias); 20 Mar 2011 14:59:49 -0000 Received: (qmail 23383 invoked by uid 22791); 20 Mar 2011 14:59:48 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_LN X-Spam-Check-By: sourceware.org Received: from mail-ww0-f51.google.com (HELO mail-ww0-f51.google.com) (74.125.82.51) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Mar 2011 14:59:42 +0000 Received: by wwj40 with SMTP id 40so5661609wwj.8 for ; Sun, 20 Mar 2011 07:59:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.179.140 with SMTP id bq12mr3204249wbb.152.1300633179927; Sun, 20 Mar 2011 07:59:39 -0700 (PDT) Received: by 10.227.129.76 with HTTP; Sun, 20 Mar 2011 07:59:39 -0700 (PDT) In-Reply-To: References: Date: Sun, 20 Mar 2011 14:59:00 -0000 Message-ID: Subject: Re: g++ 4.6 and suggested flags From: Jonathan Wakely To: denis campredon Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg00289.txt.bz2 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 =91DisplayBoard::DisplayBoard(int, int)= =92: > displayboard.cpp:47:22: error: invalid conversion from =91void (* > (*)())(int)=92 to =91sighandler_t=92 [-fpermissive] > displayboard.cpp:41:16: error: =A0 initializing argument 2 of =91void (* > signal(int, sighandler_t))(int)=92 [-fpermissive] > > > So, I tried to compile with the flag suggested > > > g++ displayboard.cpp -lncurses -c -fpermissive > displayboard.cpp: In constructor =91DisplayBoard::DisplayBoard(int, int)= =92: > displayboard.cpp:47:22: warning: invalid conversion from =91void (* > (*)())(int)=92 to =91sighandler_t=92 [-fpermissive] > displayboard.cpp:41:16: warning: =A0 initializing argument 2 of =91void (* > signal(int, sighandler_t))(int)=92 [-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-help@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.