On Tue, Feb 28, 2012 at 09:57:38AM +0100, Paolo Bonzini wrote: > Il 28/02/2012 09:50, Jakub Jelinek ha scritto: > > - $(EGREP) -v '#(#| |$$)' $@.tmp | \ > > + $(EGREP) -v '^[ ]*#(#| |$$)' $@.tmp | \ > > I don't know this part very well, so I wonder why you have to remove > comments at all... hence I wonder if sed 's/##.*//;s/# .*//;s/#$//' > (alternation is not portable in sed) would be closer to the original > intentions.
The reason for comment removal is that we pipe this into the preprocessor, which without the removal spits hundreds of <stdin>:25:7: error: invalid preprocessing directive #Names <stdin>:33:7: error: invalid preprocessing directive #std etc. errors. Preprocessing directives are only recognized at the start of the lines, after optional whitespace, so other comments are just fine. Jakub