]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Fix regression of AC_CHECK_SIZEOF on pointer types.
authorEric Blake <eblake@redhat.com>
Tue, 6 Jul 2010 20:00:44 +0000 (22:00 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 10 Jul 2010 06:16:35 +0000 (08:16 +0200)
* 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 consider `*' as literal.
(_AS_TR_CPP): Likewise.
* tests/semantics.at (AC_CHECK_ALIGNOF struct): When checking
for numeric answer, be sure to not allow variable references.
(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.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
NEWS
doc/autoconf.texi
lib/autoconf/types.m4
lib/m4sugar/m4sh.m4
tests/semantics.at

index e9e465b6477f802bbc4427f31ed6e397cf93d523..33eca5a321bbc6b18d9c87036104803f8b4d46ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2010-07-10  Eric Blake  <eblake@redhat.com>
+       and Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       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 consider `*' as literal.
+       (_AS_TR_CPP): Likewise.
+       * tests/semantics.at (AC_CHECK_ALIGNOF struct): When checking
+       for numeric answer, be sure to not allow variable references.
+       (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.
+
 2010-07-08  Eric Blake  <eblake@redhat.com>
        and Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
diff --git a/NEWS b/NEWS
index 505355791728067273bbdf58cb361a9b3f9562b8..6256d4098958c41f2d4756192a6208f697f275b5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,9 @@ GNU Autoconf NEWS - User visible changes.
 ** AC_CONFIG_SUBDIRS with more than one subdirectory at a time works again.
    Regression introduced in 2.66.
 
+** AC_CHECK_SIZEOF of a pointer type works again.  Regression introduced in
+   2.66.
+
 * Major changes in Autoconf 2.66 (2010-07-02) [stable]
   Released by Eric Blake, based on git versions 2.65.*.
 
index 39c2ba608bf9c671ca3bedfba99e22fc3c45749d..76b01c974888492a2cd9c6203670927d1bf89fca 100644 (file)
@@ -6957,6 +6957,7 @@ argument was used when cross-compiling.
 For example, the call
 
 @example
+@c If you change this example, adjust tests/semantics.at:AC_F77_DUMMY_MAIN usage.
 AC_CHECK_SIZEOF([int *])
 @end example
 
index ee07148dae99119839db5db6b3903b459b6bf3e3..9f482da02ceb3a28541e349f768888f30b181ef3 100644 (file)
@@ -763,7 +763,7 @@ Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])
 # AC_CHECK_SIZEOF(TYPE, [IGNORED], [INCLUDES = DEFAULT-INCLUDES])
 # ---------------------------------------------------------------
 AC_DEFUN([AC_CHECK_SIZEOF],
-[AS_LITERAL_IF([$1], [],
+[AS_LITERAL_IF(m4_translit([[$1]], [*], [p]), [],
               [m4_fatal([$0: requires literal arguments])])]dnl
 [# The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
index e1d03d97907ffca8f88bdb577a02444326d67333..6fbc9e13c63d1218998c097512a5e49763f45ed5 100644 (file)
@@ -1779,7 +1779,7 @@ m4_defun_init([AS_TR_SH],
 [_$0(m4_expand([$1]))])
 
 m4_define([_AS_TR_SH],
-[_AS_LITERAL_IF([$1], [         ][
+[_AS_LITERAL_IF([$1], [*][      ][
 ])([], [$0_INDIR], [$0_LITERAL])([$1])])
 
 m4_define([_AS_TR_SH_LITERAL],
@@ -1812,7 +1812,7 @@ m4_defun_init([AS_TR_CPP],
 [_$0(m4_expand([$1]))])
 
 m4_define([_AS_TR_CPP],
-[_AS_LITERAL_IF([$1], [         ][
+[_AS_LITERAL_IF([$1], [*][      ][
 ])([], [$0_INDIR], [$0_LITERAL])([$1])])
 
 m4_define([_AS_TR_CPP_LITERAL],
index b703fd41d4eaba7c05353d3ab4b6aec64883788c..48136cd2f16251a815929431bdb093a377d1e985 100644 (file)
@@ -350,7 +350,7 @@ AT_CHECK_MACRO_CROSS([AC_CHECK_ALIGNOF struct],
 [[AC_CHECK_ALIGNOF([struct { char c; }])
 AC_CHECK_ALIGNOF([struct nosuchstruct])
 ]],
-[AT_CHECK([[grep "#define ALIGNOF_STRUCT___CHAR_C___ [^0]" config.h]],
+[AT_CHECK([[grep "#define ALIGNOF_STRUCT___CHAR_C___ [1-9]" config.h]],
         0, ignore)
 AT_CHECK([[grep "#define ALIGNOF_STRUCT_NOSUCHSTRUCT 0" config.h]],
         0, ignore)
@@ -379,13 +379,17 @@ AT_CHECK_MACRO_CROSS([AC_CHECK_SIZEOF struct],
 AC_CHECK_SIZEOF([struct x], [], [struct x { char c; int x; };])
 AC_CHECK_SIZEOF([const struct x], [], [struct x { const char *p; int x; };])
 AC_CHECK_SIZEOF([struct nosuchstruct])
+# Taken from autoconf.texi:Generic Compiler Characteristics.
+AC_CHECK_SIZEOF([int *])
 ]],
-[AT_CHECK([[grep "#define SIZEOF_STRUCT_X [^0]" config.h]],
+[AT_CHECK([[grep "#define SIZEOF_STRUCT_X [1-9]" config.h]],
         0, ignore)
-AT_CHECK([[grep "#define SIZEOF_CONST_STRUCT_X [^0]" config.h]],
+AT_CHECK([[grep "#define SIZEOF_CONST_STRUCT_X [1-9]" config.h]],
         0, ignore)
 AT_CHECK([[grep "#define SIZEOF_STRUCT_NOSUCHSTRUCT 0" config.h]],
         0, ignore)
+AT_CHECK([[grep "#define SIZEOF_INT_P [1-9]" config.h]],
+        0, ignore)
 ])