[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Wed Apr 8 15:15:30 UTC 2015


The branch master has been updated
       via  2da2a4349c1598ad0648405fe175e7846d893c45 (commit)
       via  04958e84d8079fa57a782db70f003c38b5b156fd (commit)
       via  c25dea53e9db2b4956c315f85dae3f1c2854fd2b (commit)
      from  40cf45456602ae3d7e6c00fdbe0f5eeab24f8afc (commit)


- Log -----------------------------------------------------------------
commit 2da2a4349c1598ad0648405fe175e7846d893c45
Author: Richard Levitte <levitte at openssl.org>
Date:   Sat Apr 4 16:53:44 2015 +0200

    Appease clang -Wshadow
    
    The macros BSWAP4 and BSWAP8 have statetemnt expressions
    implementations that use local variable names that shadow variables
    outside the macro call, generating warnings like this
    
    e_aes_cbc_hmac_sha1.c:263:14: warning: declaration shadows a local variable
          [-Wshadow]
        seqnum = BSWAP8(blocks[0].q[0]);
                 ^
    ../modes/modes_lcl.h:41:29: note: expanded from macro 'BSWAP8'
                                ^
    e_aes_cbc_hmac_sha1.c:223:12: note: previous declaration is here
        size_t ret = 0;
               ^
    
    Have clang be quiet by modifying the macro variable names slightly
    (suffixing them with an underscore).
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit 04958e84d8079fa57a782db70f003c38b5b156fd
Author: Richard Levitte <levitte at openssl.org>
Date:   Sat Apr 4 16:33:20 2015 +0200

    Appease clang -Wgnu-statement-expression
    
    We use GNU statement expressions in crypto/md32_common.h, surrounded
    by checks that GNU C is indeed used to compile.  It seems that clang,
    at least on Linux, pretends to be GNU C, therefore finds the statement
    expressions and then warns about them.
    
    The solution is to have clang be quiet about it.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

commit c25dea53e9db2b4956c315f85dae3f1c2854fd2b
Author: Richard Levitte <levitte at openssl.org>
Date:   Sat Apr 4 16:22:26 2015 +0200

    Appease clang -Wempty-translation-unit
    
    ebcdic.c:284:7: warning: ISO C requires a translation unit to contain at least one
          declaration [-Wempty-translation-unit]
          ^
    1 warning generated.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 Configure                |  2 +-
 crypto/ebcdic.c          |  2 +-
 crypto/modes/modes_lcl.h | 38 +++++++++++++++++++-------------------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/Configure b/Configure
index 97c2573..d51653a 100755
--- a/Configure
+++ b/Configure
@@ -112,7 +112,7 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimenta
 
 my $gcc_devteam_warn = "-Wall -pedantic -DPEDANTIC -Wno-long-long -Wsign-compare -Wmissing-prototypes -Wshadow -Wformat -Werror -DCRYPTO_MDEBUG_ALL -DCRYPTO_MDEBUG_ABORT -DREF_CHECK -DDEBUG_UNUSED";
 
-my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum";
+my $clang_disabled_warnings = "-Wno-language-extension-token -Wno-extended-offsetof -Wno-padded -Wno-shorten-64-to-32 -Wno-format-nonliteral -Wno-missing-noreturn -Wno-unused-parameter -Wno-sign-conversion -Wno-unreachable-code -Wno-conversion -Wno-documentation -Wno-missing-variable-declarations -Wno-cast-align -Wno-incompatible-pointer-types-discards-qualifiers -Wno-missing-variable-declarations -Wno-missing-field-initializers -Wno-unused-macros -Wno-disabled-macro-expansion -Wno-conditional-uninitialized -Wno-switch-enum -Wno-gnu-statement-expression";
 
 my $strict_warnings = 0;
 
diff --git a/crypto/ebcdic.c b/crypto/ebcdic.c
index 4b7652c..fd6df92 100644
--- a/crypto/ebcdic.c
+++ b/crypto/ebcdic.c
@@ -3,7 +3,7 @@
 #ifndef CHARSET_EBCDIC
 
 # include <openssl/e_os2.h>
-# if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX)
+# if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX) || defined(__clang__)
 static void *dummy = &dummy;
 # endif
 
diff --git a/crypto/modes/modes_lcl.h b/crypto/modes/modes_lcl.h
index 90b92c0..0fd11ce 100644
--- a/crypto/modes/modes_lcl.h
+++ b/crypto/modes/modes_lcl.h
@@ -38,36 +38,36 @@ typedef unsigned char u8;
 #if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM)
 # if defined(__GNUC__) && __GNUC__>=2
 #  if defined(__x86_64) || defined(__x86_64__)
-#   define BSWAP8(x) ({ u64 ret=(x);                    \
+#   define BSWAP8(x) ({ u64 ret_=(x);                   \
                         asm ("bswapq %0"                \
-                        : "+r"(ret));   ret;            })
-#   define BSWAP4(x) ({ u32 ret=(x);                    \
+                        : "+r"(ret_));   ret_;          })
+#   define BSWAP4(x) ({ u32 ret_=(x);                   \
                         asm ("bswapl %0"                \
-                        : "+r"(ret));   ret;            })
+                        : "+r"(ret_));   ret_;          })
 #  elif (defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)
-#   define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x);     \
+#   define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x);   \
                         asm ("bswapl %0; bswapl %1"     \
-                        : "+r"(hi),"+r"(lo));           \
-                        (u64)hi<<32|lo;                 })
-#   define BSWAP4(x) ({ u32 ret=(x);                    \
+                        : "+r"(hi_),"+r"(lo_));         \
+                        (u64)hi_<<32|lo_;               })
+#   define BSWAP4(x) ({ u32 ret_=(x);                   \
                         asm ("bswapl %0"                \
-                        : "+r"(ret));   ret;            })
+                        : "+r"(ret_));   ret_;          })
 #  elif defined(__aarch64__)
-#   define BSWAP8(x) ({ u64 ret;                        \
+#   define BSWAP8(x) ({ u64 ret_;                       \
                         asm ("rev %0,%1"                \
-                        : "=r"(ret) : "r"(x)); ret;     })
-#   define BSWAP4(x) ({ u32 ret;                        \
+                        : "=r"(ret_) : "r"(x)); ret_;   })
+#   define BSWAP4(x) ({ u32 ret_;                       \
                         asm ("rev %w0,%w1"              \
-                        : "=r"(ret) : "r"(x)); ret;     })
+                        : "=r"(ret_) : "r"(x)); ret_;   })
 #  elif (defined(__arm__) || defined(__arm)) && !defined(STRICT_ALIGNMENT)
-#   define BSWAP8(x) ({ u32 lo=(u64)(x)>>32,hi=(x);     \
+#   define BSWAP8(x) ({ u32 lo_=(u64)(x)>>32,hi_=(x);   \
                         asm ("rev %0,%0; rev %1,%1"     \
-                        : "+r"(hi),"+r"(lo));           \
-                        (u64)hi<<32|lo;                 })
-#   define BSWAP4(x) ({ u32 ret;                        \
+                        : "+r"(hi_),"+r"(lo_));         \
+                        (u64)hi_<<32|lo_;               })
+#   define BSWAP4(x) ({ u32 ret_;                       \
                         asm ("rev %0,%1"                \
-                        : "=r"(ret) : "r"((u32)(x)));   \
-                        ret;                            })
+                        : "=r"(ret_) : "r"((u32)(x)));  \
+                        ret_;                           })
 #  endif
 # elif defined(_MSC_VER)
 #  if _MSC_VER>=1300


More information about the openssl-commits mailing list