[Top][All Lists]

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

Re: AC_CHECK_SIZEOF([int *]) is error in autoconf-2.66

From: Eric Blake
Subject: Re: AC_CHECK_SIZEOF([int *]) is error in autoconf-2.66
Date: Wed, 7 Jul 2010 01:17:30 -0400 (EDT)

----- "Ralf Wildenhues" <address@hidden> wrote:
> Hello,

Hello Ralf, and thanks for helping pursue this.

> > On Sat, 3 Jul 2010 18:28:27 -0400 (EDT) Eric Blake wrote:
> > > Indeed, I spent a bit more time, and reproduced your follow-on
> > > issue.  Here's the complete patch (the same as before in
> types.m4,
> > > plus a new patch in m4sh.m4), which should resolve the issue.
> Patch here.  Eric, I'm not quite sure why you added the + to the
> _AS_TR_SH case.  Can you explain, so I can add testsuite coverage?
> Thanks.

The AS_TR_SH change was for the separate feature change in 2.66 of allowing
AS_ARG_WITH to allow + signs: the shell variable $as_with_c__ should
be allowed when you use ./configure --enable-c++ (typing from memory
here, so I may have some details off).  To date, we use AS_TR_SH in
more places than AS_TR_CPP (namely, in the creation of shell variables
to track configure options), explaining the asymmetry between the
characters accepted by the two.

> More generaly, I'm not sure whether we should be testing all sorts of
> other characters, or what tests I should be adding to tests/
> AS_TR_SH and AS_TR_CPP to expose these issues.  Did your patch series
> intend to have any user-visible semantic impact at all (for existing
> prior defined semantics)?

I did document in the NEWS that AS_LITERAL_IF has tighter semantics,
and treats some things as non-literals that used to be treated as
literals.  The problem stems from how many places in the code
indirectly use portions of AS_LITERAL_IF, but allow different
sets of characters (most notable were AS_TR_SH and AS_TR_CPP).  The
intent was not to break existing semantics, but to use less m4
processing power (m4_translit is much faster than m4_regexp) for
setting up the heuristic for deciding whether an input string
is likely to be a shell literal.

> OK to commit?
> Thanks,
> Ralf
> 2010-07-06  Eric Blake  <address@hidden>
>       and Ralf Wildenhues  <address@hidden>
>       Fix regression of AC_CHECK_SIZEOF on pointer types.
>       * lib/autoconf/types.m4 (AC_CHECK_SIZEOF): Translate `*' to `p'
>       when checking literal-ness of the type, for pointer types.
>       * lib/m4sugar/m4sh.m4 (_AS_TR_SH): Also translate `+' and `*'
>       to `_'.
>       (_AS_TR_CPP): Also translate `*' to `_'.

Technically, these two changes in m4sh.m4 are along the lines of
'allow * and + as literals rather than forcing non-literal
treatment'.  Both the literal and shell versions of _AS_TR_CPP
were already set up to trigger the transliteration of * to _;
the problem was that the decision engine for whether to do the
work at m4 time or shell time was never picking m4 time before
this patch.

>       * tests/ (AC_CHECK_ALIGNOF struct): When checking
>       for numeric answer, be sure to not allow variable references.

Good catch.

>       (AC_CHECK_SIZEOF struct): Likewise.  Also, test the
>       AC_CHECK_SIZEOF([int *]) example from the manual.
>       * doc/autoconf.texi (Generic Compiler Characteristics): Add
>       example marker.
>       * NEWS: Update.
>       Reports by Nishio Futoshi and Roberto Bagnara.

Looks good to apply.

Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library

reply via email to

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