svn commit: r238563 - head/gnu/usr.bin/groff/tmac

Simon J. Gerraty sjg at juniper.net
Tue Aug 21 06:14:50 UTC 2012


>> 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



More information about the svn-src-all mailing list