Re: autoconf-2.69c released [beta]

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

 



On Tue, Sep 29, 2020 at 8:04 PM Russ Allbery <eagle@xxxxxxxxx> wrote:
>
> This is separate from the question of how Autoconf should handle old
> configure scripts and how autoupdate should work, but while you're
> manually making changes to macros anyway, you will probably be happier in
> the long run if you quote all arguments and make a habit of using AS_IF
> instead of open-coded shell if statements.
>
> # Test for C compiler __func__ support
> AS_IF([test "$ac_cv_have_C__func__" != 'yes'], [
> AC_CACHE_CHECK([for C compiler __func__ support], [ac_cv_have_C__func__],
> [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],
> [[const char *func=__func__;
> return (func != 0 ? 0 : 1);
> ]])],
> [ac_cv_have_C__func__='yes'],
> [ac_cv_have_C__func__='no'])])
>
> AS_IF([test "$ac_cv_have_C__func__" = 'yes'], [
>  AC_DEFINE([HAS_C__func__],[1],[Define if C compiler supports __func__])
> ])
> ])
>
> This will protect against a lot of edge cases.

Very much agree.  We have several reports already that the betas break
old scripts with insufficient quoting and/or open-coded if statements,
and all I can do about them is put dire warnings in NEWS, because
autoupdate can only act on obsolete _macro names_...

Also I want to point out that the AS_IF wrapping the AC_CACHE_CHECK is
unnecessary: AC_CACHE_CHECK does the same thing internally.

zw




[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux