Pete Becker
10/3/2008 7:16:00 PM
On 2008-10-03 14:06:22 -0400, Eric <ericgorr@gmail.com> said:
> On Oct 3, 1:15Â pm, Gennaro Prota <gennaro/pr...@yahoo.com> wrote:
>> Eric wrote:
>>> I am working on a large, old code base and attempting to move it to
>>> GCC 4.2. Throughout the code, there is stuff like:
>>
>>> Â char *aVar = "aString";
>>
>>> or
>>
>>> Â void aFunc( char *aVar) { ... }
>>> Â aFunc( "aString" );
>>
>>> With this latest version of GCC, such code now generates the warning:
>>
>>> Â warning: deprecated conversion from string constant to 'char*'
>>
>>> and since I hate warnings, I am wondering what the best way to handle
>>> this situation is.
>>
>>> There are, of course, some warnings which can safely be disabled and
>>> ignored...is this one of them?
>>> It doesn't seem to be based on the fact that it is 'deprecated' which
>>> I interpret as meaning the ability to do this in the future will go
>>> away.
>>
>> I'm not sure I parsed the above sentence correctly. It is deprecated
>> because it is unsafe, so the warning probably exists for both reasons
>> :-)
>>
>> But it isn't going away: it's proliferating! The current working draft
>> has an analogous one for u/U-prefixed string literals.
>
> Well, that would appear to be bad...
Or good, depending on what you think is important.
--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)