Re: AS_IF

Zack Weinberg <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.patches,gmane.comp.lib.gnulib.bugs
Message-ID <CAKCAbMiwvm+aM+vJAxhkCEwVRRSTk2Cj65=ymfpFb5Q1i9oCOg@mail.gmail.com>
On Tue, Oct 6, 2020 at 5:57 PM Bruno Haible <[email protected]> wrote:
> Paul Eggert wrote in
> <https://lists.gnu.org/archive/html/bug-gnulib/2020-10/msg00019.html>:
> > > AFAICS, this is relevant for code written directly into configure.ac. But
> > > inside an AC_DEFUN it is irrelevant, because required macros are hoisted
> > > before the body of the AC_DEFUN anyway.
...
> > But now that you mention it, AS_IF isn't needed here and I installed the
> > attached further patch. Also, to help prevent others from making a similar
> > mistake, I plan to reword the Autoconf NEWS item to start with something like
> > "Autoconf macros that use AC_REQUIRE are not safe to use in hand-written shell
> > control-flow constructs that appear outside of macros defined by AC_DEFUN."
>
> Thanks. But if you, Paul, make an incorrect assumption about what AS_IF really
> does, how many more users (who read only the documentation) will make the same
> mistake? I therefore think the documentation should be enhanced to avoid this
> misinterpretation.

I agree that this should be clarified; I just had the same
conversation in another thread. I'm not sure we should say AS_IF/CASE
are equivalent to plain shell if/case inside an AC_DEFUN; they do do
more than just make the m4 expansion stack not be empty.

Also, why is AS_FOR not documented? Maybe, instead of avoiding
mentioning it in NEWS, it should be documented?

zw
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.