diff options
author | Chad Brubaker <cbrubaker@google.com> | 2015-06-09 22:45:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-09 22:45:41 +0000 |
commit | 466cca5f2dbdfcbedc4b247af8a77c6cde2baf63 (patch) | |
tree | 48354221b18371d3673cceff0dda892502078f55 | |
parent | 62b1922b3e458fac65ab284879f0bd96ea4033f0 (diff) | |
parent | 3e37f0a2c3ccd3606aed6dc4aea4a2c8c6cf7f55 (diff) | |
download | keymaster-466cca5f2dbdfcbedc4b247af8a77c6cde2baf63.tar.gz |
Merge "Fix unused variable issues" into mnc-dev
-rw-r--r-- | Android.mk | 12 | ||||
-rw-r--r-- | android_keymaster_test.cpp | 2 | ||||
-rw-r--r-- | hkdf.cpp | 2 | ||||
-rw-r--r-- | rsa_operation.cpp | 2 |
4 files changed, 10 insertions, 8 deletions
@@ -28,7 +28,7 @@ LOCAL_SRC_FILES:= \ serializable.cpp LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include -LOCAL_CFLAGS = -Wall -Werror +LOCAL_CFLAGS = -Wall -Werror -Wunused LOCAL_MODULE_TAGS := optional LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -73,7 +73,8 @@ LOCAL_SRC_FILES:= \ LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include LOCAL_SHARED_LIBRARIES := libcrypto libkeymaster_messages -LOCAL_CFLAGS = -Wall -Werror +LOCAL_CFLAGS = -Wall -Werror -Wunused +LOCAL_CLANG_CFLAGS += -Wno-error=unused-const-variable -Wno-error=unused-private-field # Ignore benigh warnings for now. LOCAL_CLANG_CFLAGS += -Wno-error=unused-private-field LOCAL_MODULE_TAGS := optional @@ -99,8 +100,8 @@ LOCAL_SRC_FILES := \ LOCAL_C_INCLUDES := \ system/security/keystore \ $(LOCAL_PATH)/include -LOCAL_CFLAGS = -Wall -Werror -LOCAL_CLANG_CFLAGS += -Wno-error=unused-const-variable +LOCAL_CFLAGS = -Wall -Werror -Wunused +LOCAL_CLANG_CFLAGS += -Wno-error=unused-const-variable -Wno-error=unused-private-field LOCAL_SHARED_LIBRARIES := libkeymaster_messages libkeymaster1 liblog libcrypto LOCAL_MODULE_TAGS := optional LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk @@ -122,7 +123,8 @@ LOCAL_SRC_FILES := \ keymaster_enforcement_test.cpp LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/include -LOCAL_CFLAGS = -Wall -Werror +LOCAL_CFLAGS = -Wall -Werror -Wunused +LOCAL_CLANG_CFLAGS += -Wno-error=unused-const-variable -Wno-error=unused-private-field LOCAL_MODULE_TAGS := tests LOCAL_SHARED_LIBRARIES := \ libsoftkeymasterdevice \ diff --git a/android_keymaster_test.cpp b/android_keymaster_test.cpp index f567c72..0f7beea 100644 --- a/android_keymaster_test.cpp +++ b/android_keymaster_test.cpp @@ -33,7 +33,7 @@ using std::unique_ptr; extern "C" { int __android_log_print(int prio, const char* tag, const char* fmt); int __android_log_print(int prio, const char* tag, const char* fmt) { - prio, tag, fmt; + (void)prio, (void)tag, (void)fmt; return 0; } } // extern "C" @@ -47,6 +47,8 @@ Rfc5869HmacSha256Kdf::Rfc5869HmacSha256Kdf(const uint8_t* secret, size_t secret_ result = prk_hmac.Init(zeros, sizeof(zeros)); } assert(result); + // avoid the unused variable warning if asserts are disabled. + (void) result; // |prk| is a pseudorandom key (of kSHA256HashLength octets). uint8_t prk[kSHA256HashLength]; diff --git a/rsa_operation.cpp b/rsa_operation.cpp index 4b66b34..fac3ae7 100644 --- a/rsa_operation.cpp +++ b/rsa_operation.cpp @@ -28,8 +28,6 @@ namespace keymaster { -static const int MIN_PSS_SALT_LEN = 8 /* salt len */ + 2 /* overhead */; - /* static */ EVP_PKEY* RsaOperationFactory::GetRsaKey(const Key& key, keymaster_error_t* error) { const RsaKey* rsa_key = static_cast<const RsaKey*>(&key); |