From 8281e51e9411f3198346140e21a006c5d5d4451e Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 13 Jul 2016 00:40:07 -0400 Subject: Cleared most "Conditional jump or move depends on uninitialised value" (Issue 223) --- cryptlib.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cryptlib.cpp') diff --git a/cryptlib.cpp b/cryptlib.cpp index 4fa36538..943edc55 100644 --- a/cryptlib.cpp +++ b/cryptlib.cpp @@ -48,19 +48,20 @@ CRYPTOPP_COMPILE_ASSERT(sizeof(dword) == 2*sizeof(word)); #if HAVE_GCC_INIT_PRIORITY CRYPTOPP_COMPILE_ASSERT(CRYPTOPP_INIT_PRIORITY >= 101); -const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))); +const std::string DEFAULT_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 25))) = ""; const std::string AAD_CHANNEL __attribute__ ((init_priority (CRYPTOPP_INIT_PRIORITY + 26))) = "AAD"; const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; #elif HAVE_MSC_INIT_PRIORITY #pragma warning(disable: 4073) #pragma init_seg(lib) -const std::string DEFAULT_CHANNEL; +const std::string DEFAULT_CHANNEL = ""; const std::string AAD_CHANNEL = "AAD"; const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; #pragma warning(default: 4073) #else -const std::string DEFAULT_CHANNEL; -const std::string AAD_CHANNEL = "AAD"; +static const std::string s1(""), s2("AAD"); +const std::string DEFAULT_CHANNEL = s1; +const std::string AAD_CHANNEL = s2; const std::string &BufferedTransformation::NULL_CHANNEL = DEFAULT_CHANNEL; #endif -- cgit v1.2.1