Fix several warnings that arise in Android.
Android is now using Ninja so it doesn't spew so much to the terminal
and thus any warnings in BoringSSL (which builds really early in the
process) and much more obvious.
Thus this change fixes a few warnings that appear in the Android build.
Change-Id: Id255ace90fece772a1c3a718c877559ce920b960
Reviewed-on: https://boringssl-review.googlesource.com/6400
Reviewed-by: David Benjamin <davidben@chromium.org>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b5c088..54c71eb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,8 +17,8 @@
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wsign-compare -ggdb -fvisibility=hidden")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wsign-compare -ggdb -std=c++0x -fvisibility=hidden")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -Wsign-compare -Wmissing-field-initializers -ggdb -std=c++0x -fvisibility=hidden")
elseif(MSVC)
set(MSVC_DISABLED_WARNINGS_LIST
"C4100" # 'exarg' : unreferenced formal parameter
diff --git a/crypto/asn1/x_bignum.c b/crypto/asn1/x_bignum.c
index f8c62fd..5867c4f 100644
--- a/crypto/asn1/x_bignum.c
+++ b/crypto/asn1/x_bignum.c
@@ -80,7 +80,8 @@
bn_free,
0,
bn_c2i,
- bn_i2c
+ bn_i2c,
+ NULL /* prim_print */,
};
ASN1_ITEM_start(BIGNUM)
diff --git a/crypto/bio/socket_helper.c b/crypto/bio/socket_helper.c
index 01f635e..96d7c24 100644
--- a/crypto/bio/socket_helper.c
+++ b/crypto/bio/socket_helper.c
@@ -59,7 +59,7 @@
ret = 0;
for (cur = result; cur; cur = cur->ai_next) {
- if (cur->ai_addrlen > sizeof(struct sockaddr_storage)) {
+ if ((size_t) cur->ai_addrlen > sizeof(struct sockaddr_storage)) {
continue;
}
memset(out_addr, 0, sizeof(struct sockaddr_storage));
diff --git a/crypto/evp/p_dsa_asn1.c b/crypto/evp/p_dsa_asn1.c
index 4790cf6..c92068f 100644
--- a/crypto/evp/p_dsa_asn1.c
+++ b/crypto/evp/p_dsa_asn1.c
@@ -582,4 +582,7 @@
int_dsa_free,
old_dsa_priv_decode,
old_dsa_priv_encode,
+
+ NULL /* digest_verify_init_from_algorithm */,
+ NULL /* digest_sign_algorithm */,
};
diff --git a/crypto/evp/p_ec_asn1.c b/crypto/evp/p_ec_asn1.c
index 9867947..c583e0f 100644
--- a/crypto/evp/p_ec_asn1.c
+++ b/crypto/evp/p_ec_asn1.c
@@ -569,5 +569,8 @@
int_ec_free,
old_ec_priv_decode,
- old_ec_priv_encode
+ old_ec_priv_encode,
+
+ NULL /* digest_verify_init_from_algorithm */,
+ NULL /* digest_sign_algorithm */,
};
diff --git a/crypto/poly1305/poly1305_arm.c b/crypto/poly1305/poly1305_arm.c
index c06eded..5e78dc0 100644
--- a/crypto/poly1305/poly1305_arm.c
+++ b/crypto/poly1305/poly1305_arm.c
@@ -132,7 +132,7 @@
static void fe1305x2_frombytearray(fe1305x2 *r, const uint8_t *x,
unsigned long long xlen) {
- int i;
+ unsigned i;
uint8_t t[17];
for (i = 0; (i < 16) && (i < xlen); i++) {
diff --git a/crypto/x509v3/v3name_test.c b/crypto/x509v3/v3name_test.c
index a3197e6..f9f7087 100644
--- a/crypto/x509v3/v3name_test.c
+++ b/crypto/x509v3/v3name_test.c
@@ -284,7 +284,7 @@
{set_email_and_cn, "set emailAddress", 0, 1},
{set_altname_dns, "set dnsName", 1, 0},
{set_altname_email, "set rfc822Name", 0, 1},
- {NULL, NULL, 0}
+ {NULL, NULL, 0, 0},
};
static X509 *make_cert(void)