autoconf-commit
[Top][All Lists]
Advanced

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

[SCM] GNU Autoconf source repository branch, master, updated. v2.64-63-g


From: Eric Blake
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.64-63-g15f8838
Date: Wed, 21 Oct 2009 12:02:12 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=15f8838bb6239ebc16beb8472de0217a10de3d5e

The branch, master has been updated
       via  15f8838bb6239ebc16beb8472de0217a10de3d5e (commit)
      from  b4d24c2af2679e6a9cd4b2f9a9f56eb65a08dbfd (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 15f8838bb6239ebc16beb8472de0217a10de3d5e
Author: Eric Blake <address@hidden>
Date:   Tue Oct 20 08:30:03 2009 -0600

    Fix AC_TYPE_UINT64_T on Tru64 with gcc 3.4.4.
    
    * lib/autoconf/types.m4 (_AC_TYPE_UNSIGNED_INT_BODY)
    (_AC_TYPE_INT_BODY): Avoid undefined behavior of attempting shift
    wider than type.
    * NEWS: Document this.
    Reported by Rainer Orth.
    
    Signed-off-by: Eric Blake <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog             |    9 +++++++++
 NEWS                  |    4 ++++
 lib/autoconf/types.m4 |   14 ++++++++++----
 3 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 82dd475..a2f56f7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-10-20  Eric Blake  <address@hidden>
+
+       Fix AC_TYPE_UINT64_T on Tru64 with gcc 3.4.4.
+       * lib/autoconf/types.m4 (_AC_TYPE_UNSIGNED_INT_BODY)
+       (_AC_TYPE_INT_BODY): Avoid undefined behavior of attempting shift
+       wider than type.
+       * NEWS: Document this.
+       Reported by Rainer Orth.
+
 2009-10-17  Ralf Wildenhues  <address@hidden>
 
        Fix a couple of index entries in the manual.
diff --git a/NEWS b/NEWS
index f738426..666cd4f 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,10 @@ GNU Autoconf NEWS - User visible changes.
    made it fail with some Fortran compilers (regression introduced in
    2.64).
 
+** The AC_TYPE_UINT64_T and AC_TYPE_INT64_T macros have been fixed to no
+   longer mistakenly select a 32-bit type on some compilers (bug present
+   since macros were introduced in 2.59c).
+
 ** The following documented autotest macros are new:
    AT_CHECK_EUNIT
 
diff --git a/lib/autoconf/types.m4 b/lib/autoconf/types.m4
index a537967..7a73fc2 100644
--- a/lib/autoconf/types.m4
+++ b/lib/autoconf/types.m4
@@ -629,17 +629,21 @@ m4_define([_AC_TYPE_INT_BODY],
 [  AS_LINENO_PUSH([$[]1])
   AC_CACHE_CHECK([for int$[]2_t], [$[]3],
     [AS_VAR_SET([$[]3], [no])
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
      for ac_type in int$[]2_t 'int' 'long int' \
         'long long int' 'short int' 'signed char'; do
        AC_COMPILE_IFELSE(
         [AC_LANG_BOOL_COMPILE_TRY(
            [AC_INCLUDES_DEFAULT],
-           [0 < ($ac_type) (((($ac_type) 1 << ($[]2 - 2)) - 1) * 2 + 1)])],
+           [enum { N = $[]2 / 2 - 1 };
+            0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)])],
         [AC_COMPILE_IFELSE(
            [AC_LANG_BOOL_COMPILE_TRY(
               [AC_INCLUDES_DEFAULT],
-              [($ac_type) (((($ac_type) 1 << ($[]2 - 2)) - 1) * 2 + 1)
-                < ($ac_type) (((($ac_type) 1 << ($[]2 - 2)) - 1) * 2 + 2)])],
+              [enum { N = $[]2 / 2 - 1 };
+               ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1)
+                < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2)])],
            [],
            [AS_CASE([$ac_type], [int$[]2_t],
               [AS_VAR_SET([$[]3], [yes])],
@@ -679,12 +683,14 @@ m4_define([_AC_TYPE_UNSIGNED_INT_BODY],
 [  AS_LINENO_PUSH([$[]1])
   AC_CACHE_CHECK([for uint$[]2_t], $[]3,
     [AS_VAR_SET([$[]3], [no])
+     # Order is important - never check a type that is potentially smaller
+     # than half of the expected target width.
      for ac_type in uint$[]2_t 'unsigned int' 'unsigned long int' \
         'unsigned long long int' 'unsigned short int' 'unsigned char'; do
        AC_COMPILE_IFELSE(
         [AC_LANG_BOOL_COMPILE_TRY(
            [AC_INCLUDES_DEFAULT],
-           [($ac_type) -1 >> ($[]2 - 1) == 1])],
+           [(($ac_type) -1 >> ($[]2 / 2 - 1)) >> ($[]2 / 2 - 1) == 3])],
         [AS_CASE([$ac_type], [uint$[]2_t],
            [AS_VAR_SET([$[]3], [yes])],
            [AS_VAR_SET([$[]3], [$ac_type])])])


hooks/post-receive
-- 
GNU Autoconf source repository




reply via email to

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