As documented in autoconf.texi 'Shell Functions', Likewise, the state of `$?' is not reliable when entering a shell function. This has the effect that using a function as the first command in a `trap' handler can cause problems.
This hit me with FreeBSD 6.4 /bin/sh, and it trips the AS_EXIT test due to commit bbc3dc81c which assumes that $ false || AS_EXIT works; but this shell seems to reset the status upon function entry: $ sh -c 'f () { echo $?; }; false; f' 0 which means an AS_EXIT implementation using a function is a problem here. Do you see any other way out except to undo the move to use a shell function for AS_EXIT (740062eb42)? Thanks, Ralf