This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR bootstrap/19818: fix libcpp warnings (take 2)


On Thu, 2005-02-10 at 20:00 -0800, Geoff Keating wrote:
> > > Sure; however, that happens behind the back of the code that uses this
> > > data structure.  The 'const' is correctly placed to catch bugs in that
> > > code, which is what I care about.
> 
> Zack's comment is correct, from a certain point of view.  However, that 
> point of view is not shared by the compiler building GCC; that compiler 
> thinks that code in the GC is also part of "the code that uses this 
> data structure".

I think that in the long term, the distinction between the GC (allowed
to modify this data structure) and the code using the data structure
(not allowed to modify it) should be made explicit.  For example,
gengtype could write out "shadow" versions of the structures, without
the const qualifiers, and explicitly cast back and forth.

This is obviously not a 4.0 change though.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]