From 3b4813587fa2eab6daed2738f455a7145fb31f1e Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sat, 19 Dec 2020 17:11:42 +0100 Subject: [PATCH] create_server_ssl_connection(): Declare a variable at the beginning of the code block ... to silence: cc -c -pipe -fstack-protector-all -ggdb -Wshadow -Wconversion -I/usr/local/include/ -pthread -Wall -std=c89 openssl.c -o openssl.o openssl.c:1144:12: warning: GCC does not allow variable declarations in for loop initializers before C99 [-Wgcc-compat] for (int i = 0; i < sk_X509_num(chain); i++) ^ --- openssl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openssl.c b/openssl.c index 32f8f278..ecfb6bf8 100644 --- a/openssl.c +++ b/openssl.c @@ -1141,7 +1141,8 @@ extern int create_server_ssl_connection(struct client_state *csp) chain = SSL_get_peer_cert_chain(ssl); if (chain) { - for (int i = 0; i < sk_X509_num(chain); i++) + int i; + for (i = 0; i < sk_X509_num(chain); i++) { if (ssl_store_cert(csp, sk_X509_value(chain, i)) != 0) { -- 2.49.0