Skip to content

curl fails to compile with gcc, --enable-debug=yes and --with-secure-transport #11155

@FeignClaims

Description

@FeignClaims

I did this

I cloned the repository and ran the following commands:

  • autoreconf --force --install
  • ./configure --disable-shared --enable-static --prefix=/ '--bindir=${prefix}/bin' '--sbindir=${prefix}/bin' '--libdir=${prefix}/lib' '--includedir=${prefix}/include' '--oldincludedir=${prefix}/include' --with-libidn2=no --with-librtmp=no --with-libpsl=no --with-libgsasl=no --with-schannel=no --with-secure-transport=yes --with-brotli=no --enable-shared=no --enable-static=yes --enable-dict=yes --enable-file=yes --enable-ftp=yes --enable-gopher=yes --enable-http=yes --enable-imap=yes --enable-ldap=no --enable-mqtt=yes --enable-pop3=yes --enable-rtsp=yes --enable-smb=yes --enable-smtp=yes --enable-telnet=yes --enable-tftp=yes --enable-debug=no --enable-ares=no --enable-threaded-resolver=yes --enable-cookies=yes --enable-ipv6=yes --enable-manual=no --enable-verbose=yes --enable-symbol-hiding=no --enable-unix-sockets=yes --with-zstd=no --without-openssl --without-wolfssl --without-libssh2 --without-nghttp2 --with-zlib=/Users/feignclaims/.conan2/p/b/zlib5dc1ed3312917/p --with-ca-fallback=nO
  • make

However, when running make, I got the following error:

vtls/sectransp.c: In function 'TLSCipherNameForNumber':
vtls/sectransp.c:907:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
  907 |   for(size_t i = SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA + 1;
      |   ^~~
vtls/sectransp.c:907:3: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code

I set -enable-debug=no and reconfigured it, keeping the other parameters the same, and it compiled successfully.

The issue might be caused by the -std=gnu89 in CFLAGS, which is added when want_warnings is yes and the compiler_id is GNU_C.

I expected the following

A successful compilation.

curl/libcurl version

git master branch (with latest commits a64d7de)

operating system

Darwin FeignClaimsdeMacBook-Air.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:41 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T8103 arm64

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions