Fix standalone Windows release-mode builds. `cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release` fails without this patch, when building using MSVC 2013. MSVC will detect (in release builds only, it seems) that functions that call abort will never return, and then warn that any code after a call to one of them is unreachable. Since we treat warnings as errors when building, this breaks the build. While this is usually desirable, it isn't desirable in this case. Change-Id: Ie5f24b1beb60fd2b33582a2ceef4c378ad0678fb Reviewed-on: https://boringssl-review.googlesource.com/3960 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/cipher/e_aes.c b/crypto/cipher/e_aes.c index 6e4b7a0..9988345 100644 --- a/crypto/cipher/e_aes.c +++ b/crypto/cipher/e_aes.c
@@ -283,7 +283,8 @@ #endif static int aes_init_key(EVP_CIPHER_CTX *ctx, const uint8_t *key, - const uint8_t *iv, int enc) { + const uint8_t *iv, int enc) + OPENSSL_SUPPRESS_UNREACHABLE_CODE_WARNINGS { int ret, mode; EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data; @@ -404,7 +405,8 @@ static ctr128_f aes_ctr_set_key(AES_KEY *aes_key, GCM128_CONTEXT *gcm_ctx, block128_f *out_block, const uint8_t *key, - size_t key_len) { + size_t key_len) + OPENSSL_SUPPRESS_UNREACHABLE_CODE_WARNINGS { if (aesni_capable()) { aesni_set_encrypt_key(key, key_len * 8, aes_key); if (gcm_ctx != NULL) {