sectransp.c: make the code c89 compatible
No binary (build failed)
—
$ git checkout -f 954c7dfb91ad4939e89f38c0466123f29fe845ee
Previous HEAD position was 6f93d5f604 lib: fix conversion warnings with gcc on macOS
HEAD is now at 954c7dfb91 sectransp.c: make the code c89 compatible
$ git clean -fdx
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing confdefs.h
Removing config.guess
Removing config.log
Removing config.sub
Removing configure
Removing conftest.c
Removing depcomp
Removing docs/Makefile.in
Removing docs/cmdline-opts/Makefile.in
Removing docs/examples/Makefile.in
Removing docs/libcurl/Makefile.in
Removing docs/libcurl/opts/Makefile.in
Removing include/Makefile.in
Removing include/curl/Makefile.in
Removing install-sh
Removing lib/Makefile.in
Removing lib/curl_config.h.in
Removing ltmain.sh
Removing m4/libtool.m4
Removing m4/ltoptions.m4
Removing m4/ltsugar.m4
Removing m4/ltversion.m4
Removing m4/lt~obsolete.m4
Removing missing
Removing packages/Makefile.in
Removing packages/vms/Makefile.in
Removing run-compiler
Removing scripts/Makefile.in
Removing src/Makefile.in
Removing test-driver
Removing tests/Makefile.in
Removing tests/certs/Makefile.in
Removing tests/certs/scripts/Makefile.in
Removing tests/data/Makefile.in
Removing tests/http/Makefile.in
Removing tests/http/clients/Makefile.in
Removing tests/libtest/Makefile.in
Removing tests/server/Makefile.in
Removing tests/unit/Makefile.in
$ autoreconf -fi
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
libtoolize: Remember to add 'LT_INIT' to configure.ac.
configure.ac:123: installing './compile'
configure.ac:439: installing './config.guess'
configure.ac:439: installing './config.sub'
configure.ac:123: installing './install-sh'
configure.ac:129: installing './missing'
docs/examples/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
$ bash -c find . -name config.guess -exec cp /usr/share/misc/config.guess {} \;
$ bash -c find . -name config.sub -exec cp /usr/share/misc/config.sub {} \;
$ chmod +x configure
$ ./configure --disable-shared --without-ssl --disable-docs
[TIMEOUT]
| @@ -45,6 +45,11 @@ | |
| #pragma clang diagnostic ignored "-Wtautological-pointer-compare" | |
| #endif /* __clang__ */ | |
| + | #ifdef __GNUC__ |
| + | #pragma GCC diagnostic ignored "-Waddress" |
| + | #pragma GCC diagnostic ignored "-Wundef" |
| + | #endif |
| + | |
| #include <limits.h> | |
| #include <Security/Security.h> | |
| @@ -234,7 +239,7 @@ struct st_cipher { | |
| insert in between existing items to appropriate place based on | |
| cipher suite IANA number | |
| */ | |
| - | const static struct st_cipher ciphertable[] = { |
| + | static const struct st_cipher ciphertable[] = { |
| /* SSL version 3.0 and initial TLS 1.0 cipher suites. | |
| Defined since SDK 10.2.8 */ | |
| CIPHER_DEF_SSLTLS(NULL_WITH_NULL_NULL, /* 0x0000 */ | |
| @@ -900,12 +905,12 @@ CF_INLINE const char *TLSCipherNameForNumber(SSLCipherSuite cipher) | |
| /* The first ciphers in the ciphertable are continuous. Here we do small | |
| optimization and instead of loop directly get SSL name by cipher number. | |
| */ | |
| + | size_t i; |
| if(cipher <= SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA) { | |
| return ciphertable[cipher].name; | |
| } | |
| /* Iterate through the rest of the ciphers */ | |
| - | for(size_t i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1; |
| - | i < NUM_OF_CIPHERS; |
| + | for(i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1; i < NUM_OF_CIPHERS; |
| ++i) { | |
| if(ciphertable[i].num == cipher) { | |
| return ciphertable[i].name; | |
| @@ -1429,7 +1434,8 @@ static CURLcode set_ssl_version_min_max(struct Curl_cfilter *cf, | |
| static bool is_cipher_suite_strong(SSLCipherSuite suite_num) | |
| { | |
| - | for(size_t i = 0; i < NUM_OF_CIPHERS; ++i) { |
| + | size_t i; |
| + | for(i = 0; i < NUM_OF_CIPHERS; ++i) { |
| if(ciphertable[i].num == suite_num) { | |
| return !ciphertable[i].weak; | |
| } | |
| @@ -1545,6 +1551,7 @@ static CURLcode sectransp_set_selected_ciphers(struct Curl_easy *data, | |
| size_t cipher_len = 0; | |
| const char *cipher_end = NULL; | |
| bool tls_name = FALSE; | |
| + | size_t i; |
| /* Skip separators */ | |
| while(is_separator(*cipher_start)) | |
| @@ -1568,7 +1575,7 @@ static CURLcode sectransp_set_selected_ciphers(struct Curl_easy *data, | |
| /* Iterate through the cipher table and look for the cipher, starting | |
| the cipher number 0x01 because the 0x00 is not the real cipher */ | |
| cipher_len = cipher_end - cipher_start; | |
| - | for(size_t i = 1; i < NUM_OF_CIPHERS; ++i) { |
| + | for(i = 1; i < NUM_OF_CIPHERS; ++i) { |
| const char *table_cipher_name = NULL; | |
| if(tls_name) { | |
| table_cipher_name = ciphertable[i].name; | |