autoconf-patches
[Top][All Lists]
Advanced

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

Re: more efficient AS_EXIT


From: Ralf Wildenhues
Subject: Re: more efficient AS_EXIT
Date: Sun, 26 Oct 2008 05:28:45 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

* Eric Blake wrote on Sat, Oct 25, 2008 at 02:11:01PM CEST:
> According to Ralf Wildenhues on 10/25/2008 3:36 AM:
> > 
> > For bonus points, is it possible to defun AS_EXIT as plain exit for as
> > long as the trap isn't in place, or as '(exit X); exit X' for as long
> > as we are before any shell function, and the redefun it as the cool
> > version at that point?  That way you could keep using AS_EXIT
> > everywhere, consistently.
> 
> How would m4sh know whether it is in a trap context?  The user would be
> required to call the as-yet-unwritten AS_TRAP to set up all trap contexts
> for this to work (ie. any existing m4sh code that uses m4sh writes their
> own trap code without informing m4 that context has changed).  Not to
> mention the issue with diversions (just because a trap is active in the
> main body does not mean the trap is still active if you AS_REQUIRE
> additional text into an earlier diversion).  So I think it is safer to
> always assume we are in trap context.  The amount of code prior to
> functions being defined is well-defined; but maybe there, I could use
> m4_pushdef([AS_EXIT],[exit $1])/m4_popdef([AS_EXIT]) inside those few
> macros (_AS_SANITIZE, ...), so that we never see raw exit in autoconf's
> source base outside of the AS_EXIT macro.

Yes, I meant something like the latter; a general solution with knowing
about trap context seems hard.

Thanks,
Ralf




reply via email to

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