This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: why are we not using const?
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: "'Andreas Schwab'" <schwab at suse dot de>
- Cc: "'Andrew Pinski'" <pinskia at physics dot uc dot edu>, "'Richard Guenther'" <richard dot guenther at gmail dot com>, "'Kaveh R. Ghazi'" <ghazi at caipclassic dot rutgers dot edu>, <gdr at integrable-solutions dot net>, <gcc at gnu dot org>, <lopezibanez at gmail dot com>
- Date: Thu, 29 Jun 2006 15:46:59 +0100
- Subject: RE: why are we not using const?
On 29 June 2006 15:12, Andreas Schwab wrote:
> "Dave Korn" <dave.korn@artimi.com> writes:
>
>> But it's really legal to cast away const?
>
> All that matters is the effective type of the accessed object, see 6.5#7.
>
> Andreas.
Ah yes, now I remember... we had a long thread on this sometime last year,
didn't we, and decided that the compiler was in the right to ignore the
qualifiers on the pointer if it also knew that the pointer had been
initialised to point to an object for which it could see the declaration and
therefore know the real underlying type. Thanks for the pointer.
cheers,
DaveK
--
Can't think of a witty .sigline today....