This is the mail archive of the gcc@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: Compiling GCC With a C++ Compiler (g++)


Ranjit Mathew <rmathew@gmail.com> writes:

| In this particular case, we can probably resolve this 
| issue by removing "const" from tree_string but adding
| "(const char *)" to the definition of TREE_STRING_POINTER
| so that for "properly behaving" clients of a STRING_CST,
| it is still a constant.

That is the immediat way I would solve this.  What we want to prevent
is accidental modification.  So the "(const char*)" belongs to the
accessor.  This tree_string is going to be put in a union where a
priori we do not know which is going to be accessed; so the
const cannot belong to the object.  However, we can make sure that
anybody who access that field have the illusion of non-modyfiability.

-- Gaby


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