From 53ff70f68c1cc52d2b1c4e46de72dd4dbf23a305 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Sat, 6 Jan 2018 15:50:27 -0500 Subject: [PATCH] Tidy up some warnings. Updating clang seems to have upset the clang-cl build. I think because they decided -Wall now matches MSVC's semantics, which is a little nuts. Two of the warnings, however, weren't wrong, so fix those. http://llvm.org/viewvc/llvm-project?view=revision&revision=319116 Change-Id: I168e52e4e70ca7b1069e0b0db241fb5305c12b1e Reviewed-on: https://boringssl-review.googlesource.com/24684 Reviewed-by: Steven Valdez Commit-Queue: David Benjamin CQ-Verified: CQ bot account: commit-bot@chromium.org --- include/openssl/base.h | 5 +++-- include/openssl/stack.h | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/openssl/base.h b/include/openssl/base.h index cc962f313..9edaa5ca0 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -228,9 +228,10 @@ extern "C" { #define OPENSSL_FALLTHROUGH [[fallthrough]] #elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__clang__) #define OPENSSL_FALLTHROUGH [[clang::fallthrough]] -#elif defined(__cplusplus) && __cplusplus >= 201103L && __GNUC__ >= 7 +#elif defined(__cplusplus) && __cplusplus >= 201103L && defined(__GNUC__) && \ + __GNUC__ >= 7 #define OPENSSL_FALLTHROUGH [[gnu::fallthrough]] -#elif __GNUC__ >= 7 // gcc 7 +#elif defined(__GNUC__) && __GNUC__ >= 7 // gcc 7 #define OPENSSL_FALLTHROUGH __attribute__ ((fallthrough)) #else // C++11 on gcc 6, and all other cases #define OPENSSL_FALLTHROUGH diff --git a/include/openssl/stack.h b/include/openssl/stack.h index 46f57a34c..625f66e43 100644 --- a/include/openssl/stack.h +++ b/include/openssl/stack.h @@ -344,7 +344,7 @@ struct StackTraits {}; sk_##name##_deep_copy(const STACK_OF(name) *sk, \ ptrtype(*copy_func)(ptrtype), \ void (*free_func)(ptrtype)) { \ - return (STACK_OF(name) *)sk_deep_copy((_STACK *)sk, \ + return (STACK_OF(name) *)sk_deep_copy((const _STACK *)sk, \ (void *(*)(void *))copy_func, \ (void (*)(void *))free_func); \ }