From 7ca36f4956f7209817f5e56aee187feb7ca33539 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Sat, 17 Sep 2022 14:09:07 +0200 Subject: [PATCH] lib1597: make it C89-compliant again Automatic variable addresses cannot be used in an initialisation aggregate. Follow-up to 9d51329 Reported-by: Daniel Stenberg Fixes: #9524 Closes #9525 --- tests/libtest/lib1597.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/libtest/lib1597.c b/tests/libtest/lib1597.c index cb167e84fa..cf2effaa19 100644 --- a/tests/libtest/lib1597.c +++ b/tests/libtest/lib1597.c @@ -38,18 +38,18 @@ int test(char *URL) CURL *curl = NULL; int res = 0; CURLcode result = CURLE_OK; - CURLcode ok = CURLE_OK; - CURLcode bad = CURLE_BAD_FUNCTION_ARGUMENT; - CURLcode unsup = CURLE_UNSUPPORTED_PROTOCOL; - CURLcode httpcode = CURLE_UNSUPPORTED_PROTOCOL; - CURLcode httpscode = CURLE_UNSUPPORTED_PROTOCOL; curl_version_info_data *curlinfo; const char *const *proto; - char protolist[1024]; int n; int i; + static CURLcode ok = CURLE_OK; + static CURLcode bad = CURLE_BAD_FUNCTION_ARGUMENT; + static CURLcode unsup = CURLE_UNSUPPORTED_PROTOCOL; + static CURLcode httpcode = CURLE_UNSUPPORTED_PROTOCOL; + static CURLcode httpscode = CURLE_UNSUPPORTED_PROTOCOL; + static char protolist[1024]; - struct pair prots[] = { + static const struct pair prots[] = { {"goobar", &unsup}, {"http ", &unsup}, {" http", &unsup},