Skip to content

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Feb 10, 2025

Fix HAVE_GETHOSTBYNAME_R_* feature detections always failing with
CURL_WERROR=ON due to stripping a const.

Also fix the GHA/cmake-vs-configure to enable CURL_WERROR=ON to sync
this setting with ./configure which enables it by default. With that,
CI detects this issue.

CMake/CurlTests.c:73:19: error: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   73 |   char *address = "example.com";
      |                   ^~~~~~~~~~~~~

Ref: https://github.com/curl/curl/actions/runs/13225827821/job/36916564107#step:33:4198

To sync with autotools, which has it enabled by default.
@vszakats vszakats added the build label Feb 10, 2025
@vszakats vszakats marked this pull request as draft February 10, 2025 05:00
@github-actions github-actions bot added the CI Continuous Integration label Feb 10, 2025
```
        /cygdrive/d/a/curl/curl/CMake/CurlTests.c:73:19: error: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
           73 |   char *address = "example.com";
              |                   ^~~~~~~~~~~~~
```
https://github.com/curl/curl/actions/runs/13226709122/job/36921488213?pr=16278#step:7:3941
@vszakats vszakats changed the title [WIP] GHA/cmake-vs-configure: enable CURL_WERROR for CMake cmake: fix HAVE_GETHOSTBYNAME_R_* detections with CURL_WERROR=ON Feb 10, 2025
@vszakats vszakats added cmake and removed build labels Feb 10, 2025
@vszakats vszakats marked this pull request as ready for review February 10, 2025 05:11
@testclutch

This comment was marked as outdated.

@vszakats vszakats closed this in f1d1c98 Feb 10, 2025
@vszakats vszakats deleted the b-detwarn branch February 10, 2025 11:54
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Fix `HAVE_GETHOSTBYNAME_R_*` feature detections always failing with
`CURL_WERROR=ON` due to stripping a const.

Also fix the GHA/cmake-vs-configure to enable `CURL_WERROR=ON` to sync
this setting with `./configure` which enables it by default. With that,
CI detects this issue.

```
CMake/CurlTests.c:73:19: error: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   73 |   char *address = "example.com";
      |                   ^~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/13225827821/job/36916564107#step:33:4198

Closes curl#16282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration cmake

Development

Successfully merging this pull request may close these issues.

2 participants