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)


Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:

>> See the previous discussion on why you can't make GCed stuff 'const'.
>
> You did not answer to Zack's comments then:
>
>  > > these data structures are not truly
>  > > write-once; any pointers contained in them will be changed by saving
>  > > a PCH.
>  >
>  > 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.
>
> I suppose if nobody felt the need to make "source" const, I could just
> as well add a cast to remove the const when source is set.  But I
> think that this issue ought to be revisited sooner or later.

I agree.  However, I'll approve this patch now, as the PCH machinery
is unlikely to change at this point.

zw


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