public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Re: deprecated conversion from string constant to 'char *'
@ 2006-07-07 21:17 Timothy C Prince
  2006-07-07 21:43 ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy C Prince @ 2006-07-07 21:17 UTC (permalink / raw)
  To: gdr; +Cc: iant, gcc-help



-----Original Message-----
From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: tprince@myrealbox.com
Date: 07 Jul 2006 17:52:31 +0200
Subject: Re: deprecated conversion from string constant to 'char *'

Tim Prince <timothyprince@sbcglobal.net> writes:

| 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.

Are you sure you're using FSF GCC?

-- Gaby


gcc built from last Saturday's post on gcc.gnu.org/pub/gcc/snapshots

I've seen remarks about that not being a reliable source for FSF gcc.  If those aren't good to use, why not offer something better?

A colleague tried the case with another colleague's build of gcc-4.2 from a few weeks ago.  His diagnostics match what I get with g++ -m32.
Tim Prince

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: deprecated conversion from string constant to 'char *'
  2006-07-07 21:17 Re: deprecated conversion from string constant to 'char *' Timothy C Prince
@ 2006-07-07 21:43 ` Ian Lance Taylor
  2006-07-08  1:57   ` Tim Prince
  0 siblings, 1 reply; 4+ messages in thread
From: Ian Lance Taylor @ 2006-07-07 21:43 UTC (permalink / raw)
  To: Timothy C Prince; +Cc: gdr, gcc-help

"Timothy C Prince" <tprince@myrealbox.com> writes:

> gcc built from last Saturday's post on gcc.gnu.org/pub/gcc/snapshots
> 
> I've seen remarks about that not being a reliable source for FSF gcc.  If those aren't good to use, why not offer something better?

That is a reliable source for FSF gcc snapshots.

Of course snapshots are just that: a snapshot of the development in
progress.  They are not guaranteed to work.

We still can't help with you without a complete and exact description
of precisely what you are doing.

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: deprecated conversion from string constant to 'char *'
  2006-07-07 21:43 ` Ian Lance Taylor
@ 2006-07-08  1:57   ` Tim Prince
  2006-07-08 15:57     ` Ian Lance Taylor
  0 siblings, 1 reply; 4+ messages in thread
From: Tim Prince @ 2006-07-08  1:57 UTC (permalink / raw)
  To: Ian Lance Taylor; +Cc: Timothy C Prince, gdr, gcc-help

Ian Lance Taylor wrote:
> "Timothy C Prince" <tprince@myrealbox.com> writes:
> 
>> gcc built from last Saturday's post on gcc.gnu.org/pub/gcc/snapshots
>>
>> I've seen remarks about that not being a reliable source for FSF gcc.  If those aren't good to use, why not offer something better?
> 
> That is a reliable source for FSF gcc snapshots.
> 
> Of course snapshots are just that: a snapshot of the development in
> progress.  They are not guaranteed to work.
> 
> We still can't help with you without a complete and exact description
> of precisely what you are doing.
> 
> Ian
> 
> 
Ian,
The example you made up is good enough.  As you can see from the 
follow-ups, replacing 'char *' by 'const char *' in your example, or 
(consistently throughout) in my own case, solve the problem.  The 
question remains whether g++ should abort the compilation when the 
legacy source code is discovered.  If it does abort, with no option to 
continue (as it does in my testing), should it be reported as Error 
rather than warning?  Should g++ -m32 produce a diagnostic similar to 
g++ -m64?

In case it's of interest, I've investigated the following compilers:

g++ 4.2 x86-64 reports "deprecated conversion" (and aborts) when const 
is omitted

g++ 4.2 -m32 x86-64, and Windows 32-bit, fail on a bunch of libstdc++ 
problems relative to char * conversions, when const is omitted

Intel icpc 9.1 linux x86-64 doesn't care whether const is present, no 
warning available (consistent with g++ 4.0.2 as base installation)
Intel ICL 9.1 Windows x64 has STL problems when const is omitted (unable 
to verify whether that corresponds to behavior of base MSVC++ installation)
MSVC 2003 toolkit 32-bit fails on excessive warnings without const, if 
-Wall is set, otherwise accepts either version

So, I'm satisfied that 'const char *' is the correct solution, and that 
no consistent treatment of legacy code (warning/abort/no warning/STL 
failure) can be expected of current compilers.

Thanks,
Tim

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: deprecated conversion from string constant to 'char *'
  2006-07-08  1:57   ` Tim Prince
@ 2006-07-08 15:57     ` Ian Lance Taylor
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2006-07-08 15:57 UTC (permalink / raw)
  To: tprince; +Cc: gcc-help

Tim Prince <timothyprince@sbcglobal.net> writes:

> The example you made up is good enough.

Let me try this again.  In my example, in which I showed precisely
what commands I executed, the compiler worked as you want it to.  It
issued a warning, had an exit status of 0, and created an object file.

If you want gcc to be fixed, you need to show an example just like
mine: show the source code, show the command line, show the compiler
output, show the exit status, show whether there is a .o file.  That
is what I have been asking you to do.

Perhaps it would help if you read
    http://gcc.gnu.org/bugs.html

Ian

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-07-08 15:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-07 21:17 Re: deprecated conversion from string constant to 'char *' Timothy C Prince
2006-07-07 21:43 ` Ian Lance Taylor
2006-07-08  1:57   ` Tim Prince
2006-07-08 15:57     ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).