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: gengtype-{lex,yacc}.c rules broken


On Jan 13, 2003, Andreas Schwab <schwab@suse.de> wrote:

> 2003-01-13  Andreas Schwab  <schwab@suse.de>

> 	* Makefile.in ($(parsedir)/gengtype-lex.c): Fix for relative
> 	srcdir.
> 	($(parsedir)/gengtype-yacc.c): Likewise.

Thanks, this is ok.  However, if you have a spare minute...

> +	$(BISON) $(BISONFLAGS) -d -o gengtype-yacc.c $$s/gengtype-yacc.y || \
> +	{ rm -f gengtype-yacc.c && false; }
 
I'd much rather generate a file with a temporary name (say .cT) and
then rename it than removing it on failure.  The reason for preferring
a temporary name is that renaming is generally atomic, whereas
creating the entire file isn't, so if we crash half-way through the
generation, we're left with an incomplete file that won't be rebuilt
and will lead to odd failures.  Sure enough, this is often the case of
object files too, but those can be fixed by cleaning up the build
tree, whereas something that might be in the source tree doesn't quite
work as simply.  If you find a spare minute to give it a go, it'll be
appreciated.  Thanks,

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


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