[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Incompatibility with POSIX 2008--- /bin/sh -e?

From: Paul Smith
Subject: Incompatibility with POSIX 2008--- /bin/sh -e?
Date: Tue, 09 Jun 2009 13:07:13 -0400

Hi all;

I was just looking up something in the latest POSIX 2008 spec for make,
and I noticed a very significant user-visible change between 2004 and

In POSIX 2004, the description under "Makefile Execution" on how
commands were to be executed says:

        Command execution shall be as if the makefile command line were
        the argument to the system() function.

This is exactly how GNU make behaves.  However, in POSIX 2008 this
sentence has been changed:

        The execution line shall then be executed by a shell as if it
        were passed as the argument to the system() interface, _except
        that the shell -e option shall also be in effect_.

(emphasis mine)  Ouch!  That is an enormous change.  GNU make does not
use the -e flag and in fact I've closed many bugs requesting that it do
so for compatibility with other versions of make as "not a bug", on the
strength of the POSIX standard.

It seems crazy to change this in GNU make: I imagine that it would cause
problems for lots of makefiles out there that don't expect intermediate
commands in a script to error.  Or, since many other make
implementations DO set -e, maybe most makefiles would handle it and it
won't hurt that much.

Of course, alternatively we can set -e when the user adds the .POSIX
special target.

What are folks' opinions on this?  Bite the bullet and change it
generally?  Leave it as is?  Change it only for .POSIX makefiles?

 Paul D. Smith <address@hidden>          Find some GNU make tips at:            
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist

reply via email to

[Prev in Thread] Current Thread [Next in Thread]