Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2012 23:14:43 -0700
From:      "Simon J. Gerraty" <sjg@juniper.net>
To:        Garrett Cooper <yanegomi@gmail.com>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Ruslan Ermilov <ru@freebsd.org>, "David E. O'Brien" <obrien@freebsd.org>
Subject:   Re: svn commit: r238563 - head/gnu/usr.bin/groff/tmac
Message-ID:  <20120821061443.0B2D158085@chaos.jnpr.net>
In-Reply-To: <CAGH67wSGVt7vMz5NvH1HW3XWPf2PmwFJXr7Gqori1G4Ty=N2YQ@mail.gmail.com>
References:  <201207180557.q6I5vheM034018@svn.freebsd.org> <20120726084903.GA48240@lo0.su> <20120821053519.BD5A158085@chaos.jnpr.net> <CAGH67wSGVt7vMz5NvH1HW3XWPf2PmwFJXr7Gqori1G4Ty=N2YQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>> note use of && rather than ; which can be very dangerous
>
>In standard scripts I would agree. In FreeBSD pmake, I would disagree,
>but it seems that it's the odd man out:

Yes, this is because FreeBSD make still uses the shell's -e
for error detection.
NetBSD (hence bmake) abandoned that quite a while ago, as it does more
harm that good.

I had a vague recollection that the posix man page covered this, but the
text is somewhat ambiguous.  Its descripton of using system() though is
probably why most makefile authors expect the command line to be the
unit of exection and thus success/failure.

	false || echo ok

works ok even with -e, but while most makes will print ok for this one
too:

	false; test $$? != 0 && echo ok

it will fail if -e is used.
That's a contrived example, but I know David had a fun real life example
a couple of years ago that was quite painful to workaround.

--sjg




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120821061443.0B2D158085>