[RFA] Integrated cpp -include -g fix

Zack Weinberg zackw@Stanford.EDU
Thu Nov 16 22:38:00 GMT 2000


On Wed, Nov 15, 2000 at 11:06:24PM +0000, Neil Booth wrote:
> This is a fix + testcase to the integrated frontend segfault on -g
> -include, along the lines Zack suggested.  Like he said it's not
> ideal, but avoids touching all front ends, at least until after 3.0.

I might have a way to avoid touching any language-independent files.
In c-parse.in and cp/parse.y, change "%start program" to "%start
goal", and add a rule like this:

goal:
	{ init_parse_delayed (); }
	program
	{}
	;

where init_parse_delayed is as you defined it in your patch.  It ought
to be possible to collapse together the 'goal', 'program', and
possibly 'extdefs' rules, but I'm not good enough at Yacc grammar
hacking to do that.

This idea is cribbed from the Java parser, incidentally, and I'm not
sure it will work - depends on whether or not the parser calls the
lexer before it runs that first action.

zw


More information about the Gcc-bugs mailing list