This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Potential GC problem in preprocessed C++
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: Alexandre Oliva <aoliva at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sat, 17 Nov 2001 18:04:31 +0000
- Subject: Re: Potential GC problem in preprocessed C++
- References: <orsnbdj4x4.fsf@free.redhat.lsd.ic.unicamp.br>
Alexandre Oliva wrote:-
> I'm well aware the way we handle filenames and strings has changed a
> lot since back then.
Well, for the C family front ends, the input_filename /
main_input_filename stuff all points to memory ownded by cpplib, and
cpplib explicitly guarantees such memory will not disappear until you
destroy your reader object, i.e. until cc1 itself exits. So this
problem probably vanished with the tighter merging of cpplib to the
front ends that has been going on over the past year.
I'm of the opinion that the input_filename stuff is all a hack anyway,
with random code changing them, along with lineno, for its own local
reasons. lineno, input_filename and the current file stack should be
removed, and replaced with something that uses something like
line_map.{c,h} for all front ends. It does the job they're trying to
do, and does it better since you only need a lineno to describe a file
+ line location.
Neil.