This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: deprecated conversion from string constant to 'char *'
- From: Ian Lance Taylor <iant at google dot com>
- To: Derek Atkins <warlord at MIT dot EDU>
- Cc: gcc-help at gcc dot gnu dot org
- Date: 06 Feb 2007 14:59:08 -0800
- Subject: Re: deprecated conversion from string constant to 'char *'
- References: <1152231213.c7d6bd1ctprince@myrealbox.com> <m3ejwy8dlv.fsf@localhost.localdomain> <44ADE0A4.4030704@sbcglobal.net> <sjmsldjrnkk.fsf@cliodev.pgp.com>
Derek Atkins <warlord@MIT.EDU> writes:
> typedef char* PDFFileName;
> typedef const char* PDFFileNameConst;
>
> class Foo
> {
> public:
> // If you change this to PDFFileNameConst then the warning goes away
> static int Blah(const PDFFileName name);
> };
>
> int do_test()
> {
> return Foo::Blah("bzz");
> }
This is expected behaviour. "const PDFFileName" is not "const char*",
it is "char* const".
Ian