[Aldor-l] Ignoring errors where they shouldn't

David Casperson casper at unbc.ca
Sun Jan 20 18:49:50 EST 2008


On 2008-01-19, Ralf Hemmecke wrote:

> Date: Sat, 19 Jan 2008 01:00:09 +0100
> From: Ralf Hemmecke <ralf at hemmecke.de>
> To: aldor-l <aldor-l at aldor.org>
> Subject: [Aldor-l] Ignoring errors where they shouldn't
> 
> In trunk/aldor/aldor/tools/Makefile I found
>
> unixdir:
> 	-(cd unix ; $(MAKE) all)
>
> Is there some good reason why a possible error should be ignored?

I have asked myself the same question.  There seem to be other
places where errors are explicitly ignored with no apparent
reason for doing so.

Were there in fact good reasons for ignoring errors in spots like
this?  If so, do they still exist?  I would propose to remove
them from the Makefile's unless someone gives good reason for
caution.


> ...So there are in fact >3 bugs.
>
> 1) The "-" above should be removed.
> 2) Similarly in trunk/aldor/aldor/Makefile
>
> toolsdir:  envcheck
> 	-(cd tools ; $(TIMER) $(MAKE) all)
>
> 3) In trunk/aldor/aldor/tools/Makefile the following target should have
> "&&" instead of ";" in order to abort early.
>
> # zacc: Parser generator with parameterized rules. Based on Yacc.
> $(ALDORTOOLS)/zacc$(EXE): zaccgram.y zaccscan.l zacc.c zacc.h zcport.h
> cenum.h cenum.c
> 	@ (cd $(ALDORTOOLS) && \
> 		echo "$(LEX) $(SRC)/zaccscan.l" && \
> 		      $(LEX) $(SRC)/zaccscan.l && \
> 		echo "yacc -d $(SRC)/zaccgram.y" && \
> 		      yacc -d $(SRC)/zaccgram.y && \
> 		echo "mv y.tab.h zaccgram.h" && \
> 		      mv y.tab.h zaccgram.h && \
> 		echo "$(CC) $(CFLAGS) -I. -I$(SRC) \
> 		   $(SRC)/zacc.c lex.yy.c y.tab.c $(SRC)/cenum.c -o zacc$(EXE)" && \
> 		      $(CC) $(CFLAGS) -I. -I$(SRC) \
> 		   $(SRC)/zacc.c lex.yy.c y.tab.c $(SRC)/cenum.c -o zacc$(EXE) && \
> 		rm lex.yy.c y.tab.c zaccgram.h \
> 	)

This also seems to be common: joining multiple commands by ;
where && would seem preferable.  Is there some kind of
cross-platform compatibility issue here?  That is, are there Make
environments where we cannot rely on && being understood?

> 4) There are several other places where errors are ignored, but I didn't
> yet have problems with those.

The general philosophy of "fail early and fail hard" seems to be
missing from the Makefiles.  I am curious to know if there were
historical reasons for this, or if individual developers were
overriding failures in order to get Make to work, and then bad
checkins resulted.

David
-- 
Dr. David Casperson, Assistant Professor     |  casper at unbc.ca
Department of Computer Science               |  (250)   960-6672 Fax 960-5544
College of Science and Management            |  3333 University Way
University of Northern British Columbia      |  Prince George, BC   V2N 4Z9
                                              |  CANADA





More information about the Aldor-l mailing list