From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14517 invoked by alias); 7 Jul 2006 04:18:53 -0000 Received: (qmail 14489 invoked by uid 22791); 7 Jul 2006 04:18:50 -0000 X-Spam-Check-By: sourceware.org Received: from smtp102.sbc.mail.mud.yahoo.com (HELO smtp102.sbc.mail.mud.yahoo.com) (68.142.198.201) by sourceware.org (qpsmtpd/0.31) with SMTP; Fri, 07 Jul 2006 04:18:48 +0000 Received: (qmail 27777 invoked from network); 7 Jul 2006 04:18:46 -0000 Received: from unknown (HELO ?68.125.129.157?) (timothyprince@sbcglobal.net@68.125.129.157 with plain) by smtp102.sbc.mail.mud.yahoo.com with SMTP; 7 Jul 2006 04:18:46 -0000 Message-ID: <44ADE0A4.4030704@sbcglobal.net> Date: Fri, 07 Jul 2006 04:18:00 -0000 From: Tim Prince Reply-To: tprince@myrealbox.com User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Ian Lance Taylor CC: Timothy C Prince , gcc-help@gcc.gnu.org Subject: Re: deprecated conversion from string constant to 'char *' References: <1152231213.c7d6bd1ctprince@myrealbox.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2006-07/txt/msg00061.txt.bz2 Ian Lance Taylor wrote: > "Timothy C Prince" writes: > >> g++ 4.2 rejects a quoted string constant, where the function prototype has char *. It says warning, but the warning is fatal, even without -Werror. -fpermissive doesn't let it pass. >> >> info g++ lists an option -fconst-strings, but that option has been removed. >> >> What is expected as a replacement for current source code with 1000's of string constants, which up to now worked with char * prototype? > > This is what I get: > >> cat foo.cc > extern void foo(char*); > void bar() { foo("Hello"); } >> g++ -c foo.cc > foo.cc: In function ‘void bar()’: > foo.cc:2: warning: deprecated conversion from string constant to ‘char*’' >> echo $? > 0 > > Looks like a warning to me, not an error. Please give a small source > code example and the command line you are using. > > Ian > > Ian, Even in your example, gcc stops without making a .o file. I did find that correcting __all__ the relevant prototypes to 'const char *' fixed my problem. I had missed one tucked away in a long list. Another compiler which I use frequently, which claims a high degree of gcc compatibility, is unable to produce any warning. Thanks, Tim