bug-bash
[Top][All Lists]
Advanced

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

Re: trap 0 vs. gcc's configure


From: Chet Ramey
Subject: Re: trap 0 vs. gcc's configure
Date: Thu, 29 Jul 2004 11:57:48 -0400

> In bash 3.0 manually executing the command `` trap 0 '' goes fine. Also,
> putting it in a small script is fine, too.
> 
> However, if I try to compile gcc 3.3.4, when it tries to execute the
> `` trap 0 '' command at the end of its outermost configure script, it
> prints this:
> trap: usage: trap [-lp] [[arg] signal_spec ...]
> and this trap command exits with an error.
> 
> Adding a ``-x'' to the interpreter line of this configure scripts yields
> to this:
> 
> [...]
> creating ./config.status
> creating Makefile
> creating install-defs.sh
> creating config.h
> + true
> + cd /tmp/object
> + rm -rf /tmp/cNf12649
> + trap 0
> trap: usage: trap [-lp] [[arg] signal_spec ...]
> + rm -rf Makefile.tem /tmp/cNf12649
> + exit 1
> 
> 
> Strange...

This was a change made for POSIX compliance.  It works the same as previously
when not in posix mode:

caleb.INS.CWRU.Edu(2)$ ./bash
caleb.INS.CWRU.Edu(3)$ echo $BASH_VERSION
3.00.0(2)-release
caleb.INS.CWRU.Edu(3)$ trap 0
caleb.INS.CWRU.Edu(3)$ echo $?
0

POSIX says that the `action' and `condition' are both required.  The official
way to accomplish what you want is to run `trap - 0'.

(http://www.opengroup.org/onlinepubs/009695399/utilities/trap.html)

That said, backwards compatibility is an important issue.  I will take a
look and see what I can do without causing bash to fail the POSIX test
suites.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
                                                Live...Laugh...Love
Chet Ramey, ITS, CWRU    chet@po.cwru.edu    http://tiswww.tis.cwru.edu/~chet/




reply via email to

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