This is the mail archive of the
mailing list for the GCC project.
Re: Bug with assignment to const * in C (but not in C++)
- To: oliva at dcc dot unicamp dot br, rutt at tensilica dot com
- Subject: Re: Bug with assignment to const * in C (but not in C++)
- From: mrs at wrs dot com (Mike Stump)
- Date: Wed, 3 Feb 1999 12:08:38 -0800
- Cc: egcs-bugs at cygnus dot com
> From: "John C. Ruttenberg" <email@example.com>
> Date: Wed, 3 Feb 1999 10:53:28 -0500 (EST)
> To: Alexandre Oliva <firstname.lastname@example.org>
> Cc: email@example.com
> Alexandre Oliva:
> > The code snipped assigns a `char**' to a `char const*const*', which is
> > fine. It would be incorrect to assign a `char***' to a `char
> > const*const**'
> I guess I am still not making myself clear. gcc and g++ behave differently.
Yes, this is true.
> Is this right.
What answer do you want? Yes, this was intentional as the ANSI
Standard for C++ differs from the ANSI standard for C. No, this is
not right, the ANSI standard for C is broken and gcc should not follow
it, but rather be forward compatible with the next ANSI standard for
C, since they will put this feature into the next standard.
> It seems that one of them is probably wrong.
Yes, gcc. Or not, gcc just is being too compatible with ANSI C on
My own personal take is that gcc should be `fixed'.