build: fix some -Wsign-conversion/-Warith-conversion warnings#12492
Closed
vszakats wants to merge 10 commits intocurl:masterfrom
Closed
build: fix some -Wsign-conversion/-Warith-conversion warnings#12492vszakats wants to merge 10 commits intocurl:masterfrom
-Wsign-conversion/-Warith-conversion warnings#12492vszakats wants to merge 10 commits intocurl:masterfrom
Conversation
c657225 to
f31da30
Compare
-Wsign-conversion-Wsign-conversion warnings
6e8616e to
eaf8ca0
Compare
-Wsign-conversion warnings-Wsign-conversion/-Warith-conversion warnings
Member
Author
|
E.g.:
510-520 unique warnings in each, probably with large overlap. There are a few options to proceed with this:
|
and indentation Ref: https://github.com/curl/curl/actions/runs/7148682295/job/19469980314?pr=12492#step:29:1235 ``` inet_pton.c:115:35: error: conversion to 'unsigned int' from 'int' may change the sign of the result [-Werror=arith-conversion] 115 | unsigned int val = *tp * 10 + (unsigned int)(pch - digits); | ^ ``` Ref: https://dev.azure.com/daniel0244/curl/_build/results?buildId=18964&view=logs&jobId=fd8b539a-45be-52ee-427b-3ad3fdec5ebd&j=81bb90a1-709c-5261-a92d-4869708fd1b6&t=5cd3fffe-65e4-58bd-82d3-f0b036b20e6c
vszakats
added a commit
that referenced
this pull request
Dec 20, 2023
Fix remaining warnings in examples and tests which are not suppressed by the pragma in `lib/curl_setup.h`. Silence a toolchain issue causing warnings in `FD_SET()` calls with older Cygwin/MSYS2 builds. Likely fixed on 2020-08-03 by: https://cygwin.com/git/?p=newlib-cygwin.git;a=commitdiff;h=5717262b8ecfed0f7fab63e2c09c78991e36f9dd Follow-up to 2dbe75b #12492 Closes #12557
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-Wsign-conversionwarnings, but also setting them to notraise errors.
-Warith-conversionwarnings seen in CI.These are triggered by
-Wsign-converionand causing errors unlessexplicitly silenced. It makes more sense to fix them, there just a few
of them.
-Wsign-conversionwarnings.-Wsign-conversionwarnings with a#pragma.CURL_WARN_SIGN_CONVERSIONto unhide them on a per-buildbasis.
https://github.com/curl/curl/actions/workflows/linux.yml -> OpenSSL -O3
TODO:
-Wsign-conversionwarnings. [FUTURE]CURL_WARN_SIGN_CONVERSIONlogic and delete-Wno-error=sign-conversionoptions. [FUTURE]