aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-04-06 12:47:35 +0200
committerAndy Polyakov <appro@openssl.org>2016-04-07 21:18:00 +0200
commit463a7b8cb0a449512448155a477f1460d8c951d9 (patch)
tree89baa5628a0eeee759ecad222b8bc0213275772e
parentc32cbe97873bf919dc4d1bc332e4758ee6caea78 (diff)
downloadopenssl-463a7b8cb0a449512448155a477f1460d8c951d9.zip
openssl-463a7b8cb0a449512448155a477f1460d8c951d9.tar.gz
openssl-463a7b8cb0a449512448155a477f1460d8c951d9.tar.bz2
Clean-up *_DEBUG options.
Since NDEBUG is defined unconditionally on command line for release builds, we can omit *_DEBUG options in favour of effective "all-on" in debug builds exercised though CI. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
-rw-r--r--Configurations/10-main.conf11
-rwxr-xr-xConfigure17
-rw-r--r--crypto/aes/aes_core.c5
-rw-r--r--crypto/aes/aes_ecb.c5
-rw-r--r--crypto/aes/aes_x86core.c5
-rw-r--r--crypto/bio/b_print.c7
-rw-r--r--crypto/blake2/blake2b.c5
-rw-r--r--crypto/blake2/blake2s.c5
-rw-r--r--crypto/bn/bn_asm.c5
-rw-r--r--crypto/bn/bn_lib.c5
-rw-r--r--crypto/bn/bn_mul.c5
-rw-r--r--e_os.h5
-rw-r--r--ssl/ssl_lib.c10
13 files changed, 21 insertions, 69 deletions
diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf
index a36109c..6b10d70 100644
--- a/Configurations/10-main.conf
+++ b/Configurations/10-main.conf
@@ -110,7 +110,7 @@ sub vms_info {
inherit_from => [ "BASE_unix" ],
cc => "gcc",
cflags => picker(default => "-Wall -DOPENSSL_SYS_VOS -D_POSIX_C_SOURCE=200112L -D_BSD -D_VOS_EXTENDED_NAMES -DB_ENDIAN",
- debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
+ debug => "-O0 -g",
release => "-O3"),
thread_scheme => "(unknown)",
sys_id => "VOS",
@@ -220,8 +220,7 @@ sub vms_info {
# -m32 should be safe to add as long as driver recognizes
# -mcpu=ultrasparc
inherit_from => [ "solaris-sparcv7-gcc", asm("sparcv9_asm") ],
- cflags => add_before(picker(default => "-m32 -mcpu=ultrasparc",
- debug => "-DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -O -g -pedantic -ansi -Wshadow -Wno-long-long -D__EXTENSIONS__")),
+ cflags => add_before("-m32 -mcpu=ultrasparc"),
},
"solaris64-sparcv9-gcc" => {
inherit_from => [ "solaris-sparcv9-gcc" ],
@@ -239,7 +238,7 @@ sub vms_info {
inherit_from => [ "solaris-common" ],
cc => "cc",
cflags => add_before(picker(default => "-xstrconst -Xa -DB_ENDIAN -DBN_DIV2W",
- debug => "-g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG",
+ debug => "-g",
release => "-xO5 -xdepend"),
threads("-D_REENTRANT")),
lflags => add(threads("-mt")),
@@ -600,7 +599,7 @@ sub vms_info {
inherit_from => [ "BASE_unix" ],
cc => "gcc",
cflags => combine(picker(default => "-Wall",
- debug => "-O0 -g -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG",
+ debug => "-O0 -g",
release => "-O3"),
threads("-pthread")),
ex_libs => add("-ldl"),
@@ -1655,7 +1654,7 @@ sub vms_info {
"vxworks-ppc750-debug" => {
inherit_from => [ "BASE_unix" ],
cc => "ccppc",
- cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DBN_DEBUG -DREF_DEBUG -DCONF_DEBUG -DBN_CTX_DEBUG -DPEDANTIC -DDEBUG_SAFESTACK -DDEBUG -g",
+ cflags => "-ansi -nostdinc -DPPC750 -D_REENTRANT -fvolatile -fno-builtin -fno-for-scope -fsigned-char -Wall -msoft-float -mlongcall -DCPU=PPC604 -I\$(WIND_BASE)/target/h -DPEDANTIC -DDEBUG -g",
sys_id => "VXWORKS",
lflags => "-r",
},
diff --git a/Configure b/Configure
index ef5ff9f..8e42ebf 100755
--- a/Configure
+++ b/Configure
@@ -77,10 +77,21 @@ my $usage="Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [-Dxxx] [-lx
# Minimum warning options... any contributions to OpenSSL should at least get
# past these.
-my $gcc_devteam_warn = "-DPEDANTIC -DREF_DEBUG -DDEBUG_UNUSED -DBIO_DEBUG -DBLAKE_DEBUG"
- . " -pedantic"
+# DEBUG_UNUSED enables __owur (warn unused result) checks.
+my $gcc_devteam_warn = "-DDEBUG_UNUSED"
+ # -DPEDANTIC complements -pedantic and is meant to mask code that
+ # is not strictly standard-compliant and/or implementation-specifc,
+ # e.g. inline assembly, disregards to alignment requirements, such
+ # that -pedantic would complain about. Incidentally -DPEDANTIC has
+ # to be used even in sanitized builds, because sanitizer too is
+ # supposed to and does take notice of non-standard behaviour. Then
+ # -pedantic with pre-C9x compiler would also complain about 'long
+ # long' not being supported. As 64-bit algorithms are common now,
+ # it grew impossible to resolve this without sizeable additional
+ # code, so we just tell compiler to be pedantic about everything
+ # but 'long long' type.
+ . " -DPEDANTIC -pedantic -Wno-long-long"
. " -Wall"
- . " -Wno-long-long"
. " -Wsign-compare"
. " -Wmissing-prototypes"
. " -Wshadow"
diff --git a/crypto/aes/aes_core.c b/crypto/aes/aes_core.c
index 326cc56..837d4fe 100644
--- a/crypto/aes/aes_core.c
+++ b/crypto/aes/aes_core.c
@@ -27,11 +27,6 @@
/* Note: rewritten a little bit to provide error control and an OpenSSL-
compatible API */
-#ifndef AES_DEBUG
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
#include <assert.h>
#include <stdlib.h>
diff --git a/crypto/aes/aes_ecb.c b/crypto/aes/aes_ecb.c
index 61cb0e7..6639c78 100644
--- a/crypto/aes/aes_ecb.c
+++ b/crypto/aes/aes_ecb.c
@@ -48,11 +48,6 @@
*
*/
-#ifndef AES_DEBUG
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
#include <assert.h>
#include <openssl/aes.h>
diff --git a/crypto/aes/aes_x86core.c b/crypto/aes/aes_x86core.c
index 400884a..1b64f5b 100644
--- a/crypto/aes/aes_x86core.c
+++ b/crypto/aes/aes_x86core.c
@@ -34,11 +34,6 @@
*/
-#ifndef AES_DEBUG
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
#include <assert.h>
#include <stdlib.h>
diff --git a/crypto/bio/b_print.c b/crypto/bio/b_print.c
index 17ea8af..72a2ee8 100644
--- a/crypto/bio/b_print.c
+++ b/crypto/bio/b_print.c
@@ -55,13 +55,6 @@
* [including the GNU Public Licence.]
*/
-/* disable assert() unless BIO_DEBUG has been defined */
-#ifndef BIO_DEBUG
-# ifndef NDEBUG
-# define NDEBUG
-# endif
-#endif
-
/*
* Stolen from tjh's ssl/ssl_trc.c stuff.
*/
diff --git a/crypto/blake2/blake2b.c b/crypto/blake2/blake2b.c
index 672210a..8e92a0a 100644
--- a/crypto/blake2/blake2b.c
+++ b/crypto/blake2/blake2b.c
@@ -15,11 +15,6 @@
* can be found at https://blake2.net.
*/
-#ifndef BLAKE_DEBUG
-# undef NDEBUG /* avoid conflicting definitions */
-# define NDEBUG
-#endif
-
#include <assert.h>
#include <string.h>
#include <openssl/crypto.h>
diff --git a/crypto/blake2/blake2s.c b/crypto/blake2/blake2s.c
index 03295c0..227fa10 100644
--- a/crypto/blake2/blake2s.c
+++ b/crypto/blake2/blake2s.c
@@ -15,11 +15,6 @@
* can be found at https://blake2.net.
*/
-#ifndef BLAKE_DEBUG
-# undef NDEBUG /* avoid conflicting definitions */
-# define NDEBUG
-#endif
-
#include <assert.h>
#include <string.h>
#include <openssl/crypto.h>
diff --git a/crypto/bn/bn_asm.c b/crypto/bn/bn_asm.c
index 9e9bce9..4c67d28 100644
--- a/crypto/bn/bn_asm.c
+++ b/crypto/bn/bn_asm.c
@@ -55,11 +55,6 @@
* [including the GNU Public Licence.]
*/
-#ifndef BN_DEBUG
-# undef NDEBUG /* avoid conflicting definitions */
-# define NDEBUG
-#endif
-
#include <assert.h>
#include <openssl/crypto.h>
#include "internal/cryptlib.h"
diff --git a/crypto/bn/bn_lib.c b/crypto/bn/bn_lib.c
index ce9f768..4b37906 100644
--- a/crypto/bn/bn_lib.c
+++ b/crypto/bn/bn_lib.c
@@ -55,11 +55,6 @@
* [including the GNU Public Licence.]
*/
-#ifndef BN_DEBUG
-# undef NDEBUG /* avoid conflicting definitions */
-# define NDEBUG
-#endif
-
#include <assert.h>
#include <limits.h>
#include "internal/cryptlib.h"
diff --git a/crypto/bn/bn_mul.c b/crypto/bn/bn_mul.c
index 7d4cd31..0d2a743 100644
--- a/crypto/bn/bn_mul.c
+++ b/crypto/bn/bn_mul.c
@@ -55,11 +55,6 @@
* [including the GNU Public Licence.]
*/
-#ifndef BN_DEBUG
-# undef NDEBUG /* avoid conflicting definitions */
-# define NDEBUG
-#endif
-
#include <assert.h>
#include "internal/cryptlib.h"
#include "bn_lcl.h"
diff --git a/e_os.h b/e_os.h
index f0a441e..648035d 100644
--- a/e_os.h
+++ b/e_os.h
@@ -72,15 +72,12 @@ extern "C" {
/* Used to checking reference counts, most while doing perl5 stuff :-) */
# if defined(OPENSSL_NO_STDIO)
-# if defined(REF_DEBUG)
-# error "REF_DEBUG requires stdio"
-# endif
# if defined(REF_PRINT)
# error "REF_PRINT requires stdio"
# endif
# endif
-# if defined(REF_DEBUG)
+# if !defined(NDEBUG) && !defined(OPENSSL_NO_STDIO)
# define REF_ASSERT_ISNT(test) \
(void)((test) ? (OPENSSL_die("refcount error", __FILE__, __LINE__), 1) : 0)
# else
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index 5a6e6a7..e7f90ec 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -142,9 +142,7 @@
* OTHERWISE.
*/
-#ifdef REF_DEBUG
-# include <assert.h>
-#endif
+#include <assert.h>
#include <stdio.h>
#include "ssl_locl.h"
#include <openssl/objects.h>
@@ -3318,13 +3316,7 @@ void ssl_free_wbio_buffer(SSL *s)
if (s->bbio == s->wbio) {
/* remove buffering */
s->wbio = BIO_pop(s->wbio);
-#ifdef REF_DEBUG
- /*
- * not the usual REF_DEBUG, but this avoids
- * adding one more preprocessor symbol
- */
assert(s->wbio != NULL);
-#endif
}
BIO_free(s->bbio);
s->bbio = NULL;