[sr #110377] AC_CACHE_CHECK is affected by 's' variable override.

Sergei Trofimovich <[email protected]>
Newsgroups gmane.comp.sysutils.autoconf.bugs
Message-ID <[email protected]>
URL:
  <https://savannah.gnu.org/support/?110377>

                 Summary: AC_CACHE_CHECK is affected by 's' variable override.
                 Project: Autoconf
            Submitted by: slyfox
            Submitted on: Mon 16 Nov 2020 11:42:31 AM UTC
                Category: None
                Priority: 5 - Normal
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: None

    _______________________________________________________

Details:

Initial failure happens on ruby git version against autoconf-2.69d. It has a
few issues, but I'm focusing here on redefinition of `s` variable.

Here is a minimal example that demonstrates a problem of substituted variable.
If does not show behaviour difference in minimal snippet, but points at
mangled printf argument.


$ autoreconf-2.69 --install && ./configure --host=x86_64-pc-linux-gnu
checking size of int... 1
rbcv_sizeof_size is defined as 42
ac_cv_sizeof_int=1
configure: creating ./config.status



$ autoreconf-2.70_beta3 --install && ./configure --host=x86_64-pc-linux-gnu
./configure: line 1716: printf: `r': invalid format character
./configure: line 1717: printf: `r': invalid format character
./configure: line 1724: printf: `r': invalid format character
./configure: line 1725: printf: `r': invalid format character
rbcv_sizeof_size is defined as 42
ac_cv_sizeof_int=1
configure: creating ./config.status



$ cat configure.ac
AC_INIT

dnl trimmed douwn version of orifginal 'RUBY_CHECK_SIZEOF' macro
dnl from
https://github.com/ruby/ruby/blob/master/tool/m4/ruby_check_sizeof.m4
dnl
dnl The important bit is 's' m4 variable that breaks printf call.
AC_DEFUN([RUBY_CHECK_SIZEOF],[
AS_VAR_PUSHDEF([s], [rbcv_sizeof_size])dnl
AC_CACHE_CHECK([size of $1], [AS_TR_SH([ac_cv_sizeof_$1])],
[AS_TR_SH(ac_cv_sizeof_$1)=1])

# fake use of 's' for illustratve purposes:
s=42
echo "s is defined as ${s}"

AS_VAR_POPDEF([s])
])

RUBY_CHECK_SIZEOF(int)
echo "ac_cv_sizeof_int=${ac_cv_sizeof_int}"

AC_OUTPUT





    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/support/?110377>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/
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.