From 9c9d5b3eef150a17ac1ac025a74c01ba4bfff689 Mon Sep 17 00:00:00 2001 From: miod Date: Wed, 23 Apr 2014 19:09:48 +0000 Subject: [PATCH] Unifdef -UPEDANTIC. ok beck@ tedu@ --- lib/libcrypto/asn1/n_pkey.c | 6 --- lib/libcrypto/bn/bn_div.c | 2 +- lib/libcrypto/bn/bn_lcl.h | 2 +- lib/libcrypto/camellia/camellia.c | 2 +- lib/libcrypto/des/des_locl.h | 2 +- lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c | 2 +- lib/libcrypto/evp/e_camellia.c | 6 --- lib/libcrypto/evp/p_open.c | 6 --- lib/libcrypto/md32_common.h | 38 ++++++++----------- lib/libcrypto/modes/modes_lcl.h | 2 +- lib/libcrypto/pem/pem_seal.c | 6 --- lib/libcrypto/rc5/rc5_locl.h | 2 +- lib/libcrypto/sha/sha512.c | 32 ++++++---------- lib/libssl/src/apps/dh.c | 6 --- lib/libssl/src/apps/dhparam.c | 6 --- lib/libssl/src/apps/dsa.c | 6 --- lib/libssl/src/apps/dsaparam.c | 6 --- lib/libssl/src/apps/ec.c | 6 --- lib/libssl/src/apps/ecparam.c | 6 --- lib/libssl/src/apps/engine.c | 6 --- lib/libssl/src/apps/gendh.c | 6 --- lib/libssl/src/apps/gendsa.c | 6 --- lib/libssl/src/apps/genrsa.c | 6 --- lib/libssl/src/apps/passwd.c | 3 -- lib/libssl/src/apps/rsa.c | 6 --- lib/libssl/src/apps/rsautl.c | 6 --- lib/libssl/src/crypto/asn1/n_pkey.c | 6 --- lib/libssl/src/crypto/bn/bn_div.c | 2 +- lib/libssl/src/crypto/bn/bn_lcl.h | 2 +- lib/libssl/src/crypto/camellia/camellia.c | 2 +- lib/libssl/src/crypto/des/des_locl.h | 2 +- .../src/crypto/evp/e_aes_cbc_hmac_sha1.c | 2 +- lib/libssl/src/crypto/evp/e_camellia.c | 6 --- lib/libssl/src/crypto/evp/p_open.c | 6 --- lib/libssl/src/crypto/md32_common.h | 38 ++++++++----------- lib/libssl/src/crypto/modes/modes_lcl.h | 2 +- lib/libssl/src/crypto/pem/pem_seal.c | 6 --- lib/libssl/src/crypto/rc5/rc5_locl.h | 2 +- lib/libssl/src/crypto/sha/sha512.c | 32 ++++++---------- 39 files changed, 70 insertions(+), 221 deletions(-) diff --git a/lib/libcrypto/asn1/n_pkey.c b/lib/libcrypto/asn1/n_pkey.c index 5c6181b04c5..078caf8a154 100644 --- a/lib/libcrypto/asn1/n_pkey.c +++ b/lib/libcrypto/asn1/n_pkey.c @@ -335,10 +335,4 @@ err: #endif /* OPENSSL_NO_RC4 */ -#else /* !OPENSSL_NO_RSA */ - -# if PEDANTIC -static void *dummy = &dummy; -# endif - #endif diff --git a/lib/libcrypto/bn/bn_div.c b/lib/libcrypto/bn/bn_div.c index 7817c345f05..871f29e34f8 100644 --- a/lib/libcrypto/bn/bn_div.c +++ b/lib/libcrypto/bn/bn_div.c @@ -128,7 +128,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, #else #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \ - && !defined(PEDANTIC) && !defined(BN_DIV3W) + && !defined(BN_DIV3W) # if defined(__GNUC__) && __GNUC__>=2 # if defined(__i386) || defined (__i386__) /* diff --git a/lib/libcrypto/bn/bn_lcl.h b/lib/libcrypto/bn/bn_lcl.h index 1208deb3cfa..22b4d17eb64 100644 --- a/lib/libcrypto/bn/bn_lcl.h +++ b/lib/libcrypto/bn/bn_lcl.h @@ -210,7 +210,7 @@ extern "C" { #define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ #define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ -#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) /* * BN_UMULT_HIGH section. * diff --git a/lib/libcrypto/camellia/camellia.c b/lib/libcrypto/camellia/camellia.c index 44c4202c2b9..2c024665644 100644 --- a/lib/libcrypto/camellia/camellia.c +++ b/lib/libcrypto/camellia/camellia.c @@ -87,7 +87,7 @@ #include /* 32-bit rotations */ -#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__GNUC__) && __GNUC__>=2 # if defined(__i386) || defined(__x86_64) # define RightRotate(x,s) ({u32 ret; asm ("rorl %1,%0":"=r"(ret):"I"(s),"0"(x):"cc"); ret; }) diff --git a/lib/libcrypto/des/des_locl.h b/lib/libcrypto/des/des_locl.h index bbae457377e..00fcd2a8ac9 100644 --- a/lib/libcrypto/des/des_locl.h +++ b/lib/libcrypto/des/des_locl.h @@ -152,7 +152,7 @@ } \ } -#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) # define ROTATE(a,n) ({ register unsigned int ret; \ asm ("rorl %1,%0" \ diff --git a/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c b/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c index fb2c884a786..4d76ec74d2c 100644 --- a/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c +++ b/lib/libcrypto/evp/e_aes_cbc_hmac_sha1.c @@ -90,7 +90,7 @@ typedef struct defined(_M_AMD64) || defined(_M_X64) || \ defined(__INTEL__) ) -#if defined(__GNUC__) && __GNUC__>=2 && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 # define BSWAP(x) ({ unsigned int r=(x); asm ("bswapl %0":"=r"(r):"0"(r)); r; }) #endif diff --git a/lib/libcrypto/evp/e_camellia.c b/lib/libcrypto/evp/e_camellia.c index a7b40d1c600..8bb7c320d39 100644 --- a/lib/libcrypto/evp/e_camellia.c +++ b/lib/libcrypto/evp/e_camellia.c @@ -122,10 +122,4 @@ static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 1; } -#else - -# ifdef PEDANTIC -static void *dummy=&dummy; -# endif - #endif diff --git a/lib/libcrypto/evp/p_open.c b/lib/libcrypto/evp/p_open.c index 2a5ab2b6cc5..b832ec6a6bc 100644 --- a/lib/libcrypto/evp/p_open.c +++ b/lib/libcrypto/evp/p_open.c @@ -119,10 +119,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) i = EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL); return(i); } -#else /* !OPENSSL_NO_RSA */ - -# ifdef PEDANTIC -static void *dummy=&dummy; -# endif - #endif diff --git a/lib/libcrypto/md32_common.h b/lib/libcrypto/md32_common.h index be097bfc70c..7e25b2ad3b7 100644 --- a/lib/libcrypto/md32_common.h +++ b/lib/libcrypto/md32_common.h @@ -141,16 +141,15 @@ * Engage compiler specific rotate intrinsic function if available. */ #undef ROTATE -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) /* * Some GNU C inline assembler templates. Note that these are * rotates by *constant* number of bits! But that's exactly * what we need here... * */ -# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ( \ "roll %1,%0" \ : "=r"(ret) \ @@ -158,25 +157,24 @@ : "cc"); \ ret; \ }) -# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ +# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ( \ "rlwinm %0,%1,%2,0,31" \ : "=r"(ret) \ : "r"(a), "I"(n)); \ ret; \ }) -# elif defined(__s390x__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# elif defined(__s390x__) +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ("rll %0,%1,%2" \ : "=r"(ret) \ : "r"(a), "I"(n)); \ ret; \ }) -# endif # endif -#endif /* PEDANTIC */ +#endif #ifndef ROTATE #define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) @@ -184,9 +182,8 @@ #if defined(DATA_ORDER_IS_BIG_ENDIAN) -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \ (defined(__x86_64) || defined(__x86_64__)) /* * This gives ~30-40% performance improvement in SHA-256 compiled @@ -194,13 +191,12 @@ * this trick on x86* platforms only, because these CPUs can fetch * unaligned data without raising an exception. */ -# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \ +# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \ asm ("bswapl %0":"=r"(r):"0"(r)); \ (c)+=4; (l)=r; }) -# define HOST_l2c(l,c) ({ unsigned int r=(l); \ +# define HOST_l2c(l,c) ({ unsigned int r=(l); \ asm ("bswapl %0":"=r"(r):"0"(r)); \ *((unsigned int *)(c))=r; (c)+=4; r; }) -# endif # endif #endif #if defined(__s390__) || defined(__s390x__) @@ -225,16 +221,14 @@ #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if defined(__s390x__) -# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if defined(__s390x__) +# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \ :"=d"(l) :"m"(*(const unsigned int *)(c)));\ (c)+=4; (l); }) -# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \ +# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \ :"=m"(*(unsigned int *)(c)) :"d"(l));\ (c)+=4; (l); }) -# endif # endif #endif #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) diff --git a/lib/libcrypto/modes/modes_lcl.h b/lib/libcrypto/modes/modes_lcl.h index 9057f7fd76c..2fc81382734 100644 --- a/lib/libcrypto/modes/modes_lcl.h +++ b/lib/libcrypto/modes/modes_lcl.h @@ -34,7 +34,7 @@ typedef unsigned char u8; # undef STRICT_ALIGNMENT #endif -#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if !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); \ diff --git a/lib/libcrypto/pem/pem_seal.c b/lib/libcrypto/pem/pem_seal.c index 3c0be6d305a..92b70157cdb 100644 --- a/lib/libcrypto/pem/pem_seal.c +++ b/lib/libcrypto/pem/pem_seal.c @@ -186,10 +186,4 @@ err: free(s); return (ret); } -#else /* !OPENSSL_NO_RSA */ - -# if PEDANTIC -static void *dummy = &dummy; -# endif - #endif diff --git a/lib/libcrypto/rc5/rc5_locl.h b/lib/libcrypto/rc5/rc5_locl.h index 314ce8909ac..14086c85517 100644 --- a/lib/libcrypto/rc5/rc5_locl.h +++ b/lib/libcrypto/rc5/rc5_locl.h @@ -146,7 +146,7 @@ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ *((c)++)=(unsigned char)(((l) )&0xff)) -#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) # define ROTATE_l32(a,n) ({ register unsigned int ret; \ asm ("roll %%cl,%0" \ diff --git a/lib/libcrypto/sha/sha512.c b/lib/libcrypto/sha/sha512.c index 49afaa05c25..ca7991a9ca1 100644 --- a/lib/libcrypto/sha/sha512.c +++ b/lib/libcrypto/sha/sha512.c @@ -311,21 +311,20 @@ static const SHA_LONG64 K512[80] = { U64(0x4cc5d4becb3e42b6),U64(0x597f299cfc657e2a), U64(0x5fcb6fab3ad6faec),U64(0x6c44198c4a475817) }; -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if defined(__x86_64) || defined(__x86_64__) -# define ROTR(a,n) ({ SHA_LONG64 ret; \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if defined(__x86_64) || defined(__x86_64__) +# define ROTR(a,n) ({ SHA_LONG64 ret; \ asm ("rorq %1,%0" \ : "=r"(ret) \ : "J"(n),"0"(a) \ : "cc"); ret; }) -# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \ +# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \ asm ("bswapq %0" \ : "=r"(ret) \ : "0"(ret)); ret; }) -# elif (defined(__i386) || defined(__i386__)) -# if defined(I386_ONLY) -# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ +# elif (defined(__i386) || defined(__i386__)) +# if defined(I386_ONLY) +# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ unsigned int hi=p[0],lo=p[1]; \ asm("xchgb %%ah,%%al;xchgb %%dh,%%dl;"\ "roll $16,%%eax; roll $16,%%edx; "\ @@ -333,20 +332,19 @@ static const SHA_LONG64 K512[80] = { : "=a"(lo),"=d"(hi) \ : "0"(lo),"1"(hi) : "cc"); \ ((SHA_LONG64)hi)<<32|lo; }) -# else -# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ +# else +# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ unsigned int hi=p[0],lo=p[1]; \ asm ("bswapl %0; bswapl %1;" \ : "=r"(lo),"=r"(hi) \ : "0"(lo),"1"(hi)); \ ((SHA_LONG64)hi)<<32|lo; }) -# endif -# elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) -# define ROTR(a,n) ({ SHA_LONG64 ret; \ +# endif +# elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) +# define ROTR(a,n) ({ SHA_LONG64 ret; \ asm ("rotrdi %0,%1,%2" \ : "=r"(ret) \ : "r"(a),"K"(n)); ret; }) -# endif # endif #endif @@ -560,10 +558,4 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num #endif /* SHA512_ASM */ -#else /* !OPENSSL_NO_SHA512 */ - -#if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX) -static void *dummy=&dummy; -#endif - #endif /* !OPENSSL_NO_SHA512 */ diff --git a/lib/libssl/src/apps/dh.c b/lib/libssl/src/apps/dh.c index af326a73404..c841e6826b2 100644 --- a/lib/libssl/src/apps/dh.c +++ b/lib/libssl/src/apps/dh.c @@ -313,10 +313,4 @@ end: apps_shutdown(); return (ret); } -#else /* !OPENSSL_NO_DH */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/dhparam.c b/lib/libssl/src/apps/dhparam.c index 8ca71f5e5d1..249d9a7751f 100644 --- a/lib/libssl/src/apps/dhparam.c +++ b/lib/libssl/src/apps/dhparam.c @@ -501,10 +501,4 @@ dh_cb(int p, int n, BN_GENCB * cb) return 1; } -#else /* !OPENSSL_NO_DH */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/dsa.c b/lib/libssl/src/apps/dsa.c index 6df8c25596d..9546790c0d0 100644 --- a/lib/libssl/src/apps/dsa.c +++ b/lib/libssl/src/apps/dsa.c @@ -343,10 +343,4 @@ end: apps_shutdown(); return (ret); } -#else /* !OPENSSL_NO_DSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/dsaparam.c b/lib/libssl/src/apps/dsaparam.c index af34b24f8bc..ae501b2d049 100644 --- a/lib/libssl/src/apps/dsaparam.c +++ b/lib/libssl/src/apps/dsaparam.c @@ -425,10 +425,4 @@ dsa_cb(int p, int n, BN_GENCB * cb) #endif return 1; } -#else /* !OPENSSL_NO_DSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/ec.c b/lib/libssl/src/apps/ec.c index 561b6847aab..55a65d57862 100644 --- a/lib/libssl/src/apps/ec.c +++ b/lib/libssl/src/apps/ec.c @@ -347,10 +347,4 @@ end: apps_shutdown(); return (ret); } -#else /* !OPENSSL_NO_EC */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/ecparam.c b/lib/libssl/src/apps/ecparam.c index 79ced18fa4b..7a071667c41 100644 --- a/lib/libssl/src/apps/ecparam.c +++ b/lib/libssl/src/apps/ecparam.c @@ -624,10 +624,4 @@ ecparam_print_var(BIO * out, BIGNUM * in, const char *var, BIO_printf(out, "\n\t};\n\n"); return 1; } -#else /* !OPENSSL_NO_EC */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/engine.c b/lib/libssl/src/apps/engine.c index 648d465cffd..3bf81ab0177 100644 --- a/lib/libssl/src/apps/engine.c +++ b/lib/libssl/src/apps/engine.c @@ -502,10 +502,4 @@ end: apps_shutdown(); return (ret); } -#else - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/gendh.c b/lib/libssl/src/apps/gendh.c index c09e5923a5c..94c48272797 100644 --- a/lib/libssl/src/apps/gendh.c +++ b/lib/libssl/src/apps/gendh.c @@ -216,10 +216,4 @@ dh_cb(int p, int n, BN_GENCB * cb) #endif return 1; } -#else /* !OPENSSL_NO_DH */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/gendsa.c b/lib/libssl/src/apps/gendsa.c index bcc11a2e622..f21036a608e 100644 --- a/lib/libssl/src/apps/gendsa.c +++ b/lib/libssl/src/apps/gendsa.c @@ -250,10 +250,4 @@ end: apps_shutdown(); return (ret); } -#else /* !OPENSSL_NO_DSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/genrsa.c b/lib/libssl/src/apps/genrsa.c index 5b5fbc6fa94..020bc49aafc 100644 --- a/lib/libssl/src/apps/genrsa.c +++ b/lib/libssl/src/apps/genrsa.c @@ -308,10 +308,4 @@ genrsa_cb(int p, int n, BN_GENCB * cb) #endif return 1; } -#else /* !OPENSSL_NO_RSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/passwd.c b/lib/libssl/src/apps/passwd.c index 09c427065ad..a08edb240a9 100644 --- a/lib/libssl/src/apps/passwd.c +++ b/lib/libssl/src/apps/passwd.c @@ -349,10 +349,7 @@ md5crypt(const char *passwd, const char *magic, const char *salt) buf_perm[dest] = buf[source]; buf_perm[14] = buf[5]; buf_perm[15] = buf[11]; -#ifndef PEDANTIC /* Unfortunately, this generates a "no - * effect" warning */ assert(16 == sizeof buf_perm); -#endif output = salt_out + salt_len; assert(output == out_buf + strlen(out_buf)); diff --git a/lib/libssl/src/apps/rsa.c b/lib/libssl/src/apps/rsa.c index 0e08d929ba7..eef0a921534 100644 --- a/lib/libssl/src/apps/rsa.c +++ b/lib/libssl/src/apps/rsa.c @@ -402,10 +402,4 @@ end: apps_shutdown(); return (ret); } -#else /* !OPENSSL_NO_RSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/apps/rsautl.c b/lib/libssl/src/apps/rsautl.c index dab8d6f6e34..9c5b96fa2a9 100644 --- a/lib/libssl/src/apps/rsautl.c +++ b/lib/libssl/src/apps/rsautl.c @@ -345,10 +345,4 @@ usage() } -#else /* !OPENSSL_NO_RSA */ - -#if PEDANTIC -static void *dummy = &dummy; -#endif - #endif diff --git a/lib/libssl/src/crypto/asn1/n_pkey.c b/lib/libssl/src/crypto/asn1/n_pkey.c index 5c6181b04c5..078caf8a154 100644 --- a/lib/libssl/src/crypto/asn1/n_pkey.c +++ b/lib/libssl/src/crypto/asn1/n_pkey.c @@ -335,10 +335,4 @@ err: #endif /* OPENSSL_NO_RC4 */ -#else /* !OPENSSL_NO_RSA */ - -# if PEDANTIC -static void *dummy = &dummy; -# endif - #endif diff --git a/lib/libssl/src/crypto/bn/bn_div.c b/lib/libssl/src/crypto/bn/bn_div.c index 7817c345f05..871f29e34f8 100644 --- a/lib/libssl/src/crypto/bn/bn_div.c +++ b/lib/libssl/src/crypto/bn/bn_div.c @@ -128,7 +128,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, #else #if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) \ - && !defined(PEDANTIC) && !defined(BN_DIV3W) + && !defined(BN_DIV3W) # if defined(__GNUC__) && __GNUC__>=2 # if defined(__i386) || defined (__i386__) /* diff --git a/lib/libssl/src/crypto/bn/bn_lcl.h b/lib/libssl/src/crypto/bn/bn_lcl.h index 1208deb3cfa..22b4d17eb64 100644 --- a/lib/libssl/src/crypto/bn/bn_lcl.h +++ b/lib/libssl/src/crypto/bn/bn_lcl.h @@ -210,7 +210,7 @@ extern "C" { #define BN_MUL_LOW_RECURSIVE_SIZE_NORMAL (32) /* 32 */ #define BN_MONT_CTX_SET_SIZE_WORD (64) /* 32 */ -#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) /* * BN_UMULT_HIGH section. * diff --git a/lib/libssl/src/crypto/camellia/camellia.c b/lib/libssl/src/crypto/camellia/camellia.c index 44c4202c2b9..2c024665644 100644 --- a/lib/libssl/src/crypto/camellia/camellia.c +++ b/lib/libssl/src/crypto/camellia/camellia.c @@ -87,7 +87,7 @@ #include /* 32-bit rotations */ -#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__GNUC__) && __GNUC__>=2 # if defined(__i386) || defined(__x86_64) # define RightRotate(x,s) ({u32 ret; asm ("rorl %1,%0":"=r"(ret):"I"(s),"0"(x):"cc"); ret; }) diff --git a/lib/libssl/src/crypto/des/des_locl.h b/lib/libssl/src/crypto/des/des_locl.h index bbae457377e..00fcd2a8ac9 100644 --- a/lib/libssl/src/crypto/des/des_locl.h +++ b/lib/libssl/src/crypto/des/des_locl.h @@ -152,7 +152,7 @@ } \ } -#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) # define ROTATE(a,n) ({ register unsigned int ret; \ asm ("rorl %1,%0" \ diff --git a/lib/libssl/src/crypto/evp/e_aes_cbc_hmac_sha1.c b/lib/libssl/src/crypto/evp/e_aes_cbc_hmac_sha1.c index fb2c884a786..4d76ec74d2c 100644 --- a/lib/libssl/src/crypto/evp/e_aes_cbc_hmac_sha1.c +++ b/lib/libssl/src/crypto/evp/e_aes_cbc_hmac_sha1.c @@ -90,7 +90,7 @@ typedef struct defined(_M_AMD64) || defined(_M_X64) || \ defined(__INTEL__) ) -#if defined(__GNUC__) && __GNUC__>=2 && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 # define BSWAP(x) ({ unsigned int r=(x); asm ("bswapl %0":"=r"(r):"0"(r)); r; }) #endif diff --git a/lib/libssl/src/crypto/evp/e_camellia.c b/lib/libssl/src/crypto/evp/e_camellia.c index a7b40d1c600..8bb7c320d39 100644 --- a/lib/libssl/src/crypto/evp/e_camellia.c +++ b/lib/libssl/src/crypto/evp/e_camellia.c @@ -122,10 +122,4 @@ static int camellia_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 1; } -#else - -# ifdef PEDANTIC -static void *dummy=&dummy; -# endif - #endif diff --git a/lib/libssl/src/crypto/evp/p_open.c b/lib/libssl/src/crypto/evp/p_open.c index 2a5ab2b6cc5..b832ec6a6bc 100644 --- a/lib/libssl/src/crypto/evp/p_open.c +++ b/lib/libssl/src/crypto/evp/p_open.c @@ -119,10 +119,4 @@ int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) i = EVP_DecryptInit_ex(ctx,NULL,NULL,NULL,NULL); return(i); } -#else /* !OPENSSL_NO_RSA */ - -# ifdef PEDANTIC -static void *dummy=&dummy; -# endif - #endif diff --git a/lib/libssl/src/crypto/md32_common.h b/lib/libssl/src/crypto/md32_common.h index be097bfc70c..7e25b2ad3b7 100644 --- a/lib/libssl/src/crypto/md32_common.h +++ b/lib/libssl/src/crypto/md32_common.h @@ -141,16 +141,15 @@ * Engage compiler specific rotate intrinsic function if available. */ #undef ROTATE -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) /* * Some GNU C inline assembler templates. Note that these are * rotates by *constant* number of bits! But that's exactly * what we need here... * */ -# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ( \ "roll %1,%0" \ : "=r"(ret) \ @@ -158,25 +157,24 @@ : "cc"); \ ret; \ }) -# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ +# elif defined(_ARCH_PPC) || defined(_ARCH_PPC64) || \ defined(__powerpc) || defined(__ppc__) || defined(__powerpc64__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ( \ "rlwinm %0,%1,%2,0,31" \ : "=r"(ret) \ : "r"(a), "I"(n)); \ ret; \ }) -# elif defined(__s390x__) -# define ROTATE(a,n) ({ register unsigned int ret; \ +# elif defined(__s390x__) +# define ROTATE(a,n) ({ register unsigned int ret; \ asm ("rll %0,%1,%2" \ : "=r"(ret) \ : "r"(a), "I"(n)); \ ret; \ }) -# endif # endif -#endif /* PEDANTIC */ +#endif #ifndef ROTATE #define ROTATE(a,n) (((a)<<(n))|(((a)&0xffffffff)>>(32-(n)))) @@ -184,9 +182,8 @@ #if defined(DATA_ORDER_IS_BIG_ENDIAN) -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if ((defined(__i386) || defined(__i386__)) && !defined(I386_ONLY)) || \ (defined(__x86_64) || defined(__x86_64__)) /* * This gives ~30-40% performance improvement in SHA-256 compiled @@ -194,13 +191,12 @@ * this trick on x86* platforms only, because these CPUs can fetch * unaligned data without raising an exception. */ -# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \ +# define HOST_c2l(c,l) ({ unsigned int r=*((const unsigned int *)(c)); \ asm ("bswapl %0":"=r"(r):"0"(r)); \ (c)+=4; (l)=r; }) -# define HOST_l2c(l,c) ({ unsigned int r=(l); \ +# define HOST_l2c(l,c) ({ unsigned int r=(l); \ asm ("bswapl %0":"=r"(r):"0"(r)); \ *((unsigned int *)(c))=r; (c)+=4; r; }) -# endif # endif #endif #if defined(__s390__) || defined(__s390x__) @@ -225,16 +221,14 @@ #elif defined(DATA_ORDER_IS_LITTLE_ENDIAN) -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if defined(__s390x__) -# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if defined(__s390x__) +# define HOST_c2l(c,l) ({ asm ("lrv %0,%1" \ :"=d"(l) :"m"(*(const unsigned int *)(c)));\ (c)+=4; (l); }) -# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \ +# define HOST_l2c(l,c) ({ asm ("strv %1,%0" \ :"=m"(*(unsigned int *)(c)) :"d"(l));\ (c)+=4; (l); }) -# endif # endif #endif #if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) diff --git a/lib/libssl/src/crypto/modes/modes_lcl.h b/lib/libssl/src/crypto/modes/modes_lcl.h index 9057f7fd76c..2fc81382734 100644 --- a/lib/libssl/src/crypto/modes/modes_lcl.h +++ b/lib/libssl/src/crypto/modes/modes_lcl.h @@ -34,7 +34,7 @@ typedef unsigned char u8; # undef STRICT_ALIGNMENT #endif -#if !defined(PEDANTIC) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +#if !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); \ diff --git a/lib/libssl/src/crypto/pem/pem_seal.c b/lib/libssl/src/crypto/pem/pem_seal.c index 3c0be6d305a..92b70157cdb 100644 --- a/lib/libssl/src/crypto/pem/pem_seal.c +++ b/lib/libssl/src/crypto/pem/pem_seal.c @@ -186,10 +186,4 @@ err: free(s); return (ret); } -#else /* !OPENSSL_NO_RSA */ - -# if PEDANTIC -static void *dummy = &dummy; -# endif - #endif diff --git a/lib/libssl/src/crypto/rc5/rc5_locl.h b/lib/libssl/src/crypto/rc5/rc5_locl.h index 314ce8909ac..14086c85517 100644 --- a/lib/libssl/src/crypto/rc5/rc5_locl.h +++ b/lib/libssl/src/crypto/rc5/rc5_locl.h @@ -146,7 +146,7 @@ *((c)++)=(unsigned char)(((l)>> 8L)&0xff), \ *((c)++)=(unsigned char)(((l) )&0xff)) -#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) && !defined(PEDANTIC) +#if defined(__GNUC__) && __GNUC__>=2 && !defined(__STRICT_ANSI__) && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) # if defined(__i386) || defined(__i386__) || defined(__x86_64) || defined(__x86_64__) # define ROTATE_l32(a,n) ({ register unsigned int ret; \ asm ("roll %%cl,%0" \ diff --git a/lib/libssl/src/crypto/sha/sha512.c b/lib/libssl/src/crypto/sha/sha512.c index 49afaa05c25..ca7991a9ca1 100644 --- a/lib/libssl/src/crypto/sha/sha512.c +++ b/lib/libssl/src/crypto/sha/sha512.c @@ -311,21 +311,20 @@ static const SHA_LONG64 K512[80] = { U64(0x4cc5d4becb3e42b6),U64(0x597f299cfc657e2a), U64(0x5fcb6fab3ad6faec),U64(0x6c44198c4a475817) }; -#ifndef PEDANTIC -# if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) -# if defined(__x86_64) || defined(__x86_64__) -# define ROTR(a,n) ({ SHA_LONG64 ret; \ +#if defined(__GNUC__) && __GNUC__>=2 && !defined(OPENSSL_NO_ASM) && !defined(OPENSSL_NO_INLINE_ASM) +# if defined(__x86_64) || defined(__x86_64__) +# define ROTR(a,n) ({ SHA_LONG64 ret; \ asm ("rorq %1,%0" \ : "=r"(ret) \ : "J"(n),"0"(a) \ : "cc"); ret; }) -# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \ +# define PULL64(x) ({ SHA_LONG64 ret=*((const SHA_LONG64 *)(&(x))); \ asm ("bswapq %0" \ : "=r"(ret) \ : "0"(ret)); ret; }) -# elif (defined(__i386) || defined(__i386__)) -# if defined(I386_ONLY) -# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ +# elif (defined(__i386) || defined(__i386__)) +# if defined(I386_ONLY) +# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ unsigned int hi=p[0],lo=p[1]; \ asm("xchgb %%ah,%%al;xchgb %%dh,%%dl;"\ "roll $16,%%eax; roll $16,%%edx; "\ @@ -333,20 +332,19 @@ static const SHA_LONG64 K512[80] = { : "=a"(lo),"=d"(hi) \ : "0"(lo),"1"(hi) : "cc"); \ ((SHA_LONG64)hi)<<32|lo; }) -# else -# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ +# else +# define PULL64(x) ({ const unsigned int *p=(const unsigned int *)(&(x));\ unsigned int hi=p[0],lo=p[1]; \ asm ("bswapl %0; bswapl %1;" \ : "=r"(lo),"=r"(hi) \ : "0"(lo),"1"(hi)); \ ((SHA_LONG64)hi)<<32|lo; }) -# endif -# elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) -# define ROTR(a,n) ({ SHA_LONG64 ret; \ +# endif +# elif (defined(_ARCH_PPC) && defined(__64BIT__)) || defined(_ARCH_PPC64) +# define ROTR(a,n) ({ SHA_LONG64 ret; \ asm ("rotrdi %0,%1,%2" \ : "=r"(ret) \ : "r"(a),"K"(n)); ret; }) -# endif # endif #endif @@ -560,10 +558,4 @@ static void sha512_block_data_order (SHA512_CTX *ctx, const void *in, size_t num #endif /* SHA512_ASM */ -#else /* !OPENSSL_NO_SHA512 */ - -#if defined(PEDANTIC) || defined(__DECC) || defined(OPENSSL_SYS_MACOSX) -static void *dummy=&dummy; -#endif - #endif /* !OPENSSL_NO_SHA512 */ -- 2.20.1