This is the mail archive of the
gcc-bugs@gcc.gnu.org
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" <rutt@chezrutt.com>
> Date: Wed, 3 Feb 1999 10:53:28 -0500 (EST)
> To: Alexandre Oliva <oliva@dcc.unicamp.br>
> Cc: egcs-bugs@cygnus.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
this point.
My own personal take is that gcc should be `fixed'.
:-)