New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fail if CMake with CURL_WERROR #2358

Closed
concatime opened this Issue Mar 4, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@concatime

I tried to build curl with CMake using CURL_WERROR flag. The issue is that I’m getting this error:

 # cmake .. -GNinja -DCMAKE_USE_MBEDTLS=1 -DCMAKE_USE_OPENSSL=0 -DCURL_ZLIB=1 -DCURL_WERROR=1 -DUSE_NGHTTP2=1 -DENABLE_ARES=1
 […]
 # ninja
[4/763] Building C object lib/CMakeFiles/libcurl.dir/cookie.c.o
FAILED: lib/CMakeFiles/libcurl.dir/cookie.c.o 
 […]
lib/CMakeFiles/libcurl.dir/cookie.c.o   -c ../lib/cookie.c
In file included from ../lib/curl_setup.h:56:0,
                 from ../lib/cookie.c:83:
lib/curl_config.h:987:19: error: two or more data types in declaration specifiers
 #define in_addr_t unsigned long
                   ^
lib/curl_config.h:987:28: error: two or more data types in declaration specifiers
 #define in_addr_t unsigned long
                            ^
[5/763] Building C object lib/CMakeFiles/libcurl.dir/http.c.o
FAILED: lib/CMakeFiles/libcurl.dir/http.c.o 
 […]
lib/CMakeFiles/libcurl.dir/http.c.o   -c ../lib/http.c
In file included from ../lib/curl_setup.h:56:0,
                 from ../lib/http.c:23:
lib/curl_config.h:987:19: error: two or more data types in declaration specifiers
 #define in_addr_t unsigned long
                   ^
lib/curl_config.h:987:28: error: two or more data types in declaration specifiers
 #define in_addr_t unsigned long
                            ^
ninja: build stopped: subcommand failed.

The line #define in_addr_t unsigned long should be present only once according to this comment.

@bagder bagder added the cmake label Mar 4, 2018

@snikulov

This comment has been minimized.

Show comment
Hide comment
@snikulov

snikulov Mar 19, 2018

Member

@bagder @concatime Confirmed.

The problem is - when we enforcetreat warnings as errors rule, then some symbols checks are failed because of warnings.
For example check for HAVE_IN_ADDR_T failed and we have redefinition in curl_config.h

  1. a short fix, we can move CMAKE_C_FLAGS altering with -Werror below all checks.
  2. long fix - dig into configuration checks and investigate and fix all possible warnings

Will try to fix it shortly.

Member

snikulov commented Mar 19, 2018

@bagder @concatime Confirmed.

The problem is - when we enforcetreat warnings as errors rule, then some symbols checks are failed because of warnings.
For example check for HAVE_IN_ADDR_T failed and we have redefinition in curl_config.h

  1. a short fix, we can move CMAKE_C_FLAGS altering with -Werror below all checks.
  2. long fix - dig into configuration checks and investigate and fix all possible warnings

Will try to fix it shortly.

snikulov added a commit to snikulov/curl that referenced this issue Mar 20, 2018

cmake: partial for #2358. Moved CMAKE_C_FLAGS update after the config…
…uration checks to avoid failures in case of warnings

snikulov added a commit to snikulov/curl that referenced this issue Mar 22, 2018

cmake: avoid warn-as-error during config checks
- Move the CURL_WERROR option processing after the configuration checks
  to avoid failures in case of warnings during the configuration checks.

This is a partial fix for #2358

snikulov added a commit to snikulov/curl that referenced this issue Mar 22, 2018

cmake: avoid warn-as-error during config checks
- Move the CURL_WERROR option processing after the configuration checks
  to avoid failures in case of warnings during the configuration checks.

This is a partial fix for #2358

snikulov added a commit to snikulov/curl that referenced this issue Mar 22, 2018

@snikulov snikulov closed this in 6231a89 Mar 22, 2018

snikulov added a commit that referenced this issue Mar 22, 2018

cmake: avoid warn-as-error during config checks (#2411)
- Move the CURL_WERROR option processing after the configuration checks
  to avoid failures in case of warnings during the configuration checks.

This is a partial fix for #2358

@lock lock bot locked as resolved and limited conversation to collaborators Jun 20, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.