docs: enable more compiler warnings for C snippets, fix 3 finds#21006
Closed
vszakats wants to merge 6 commits intocurl:masterfrom
Closed
docs: enable more compiler warnings for C snippets, fix 3 finds#21006vszakats wants to merge 6 commits intocurl:masterfrom
vszakats wants to merge 6 commits intocurl:masterfrom
Conversation
```
docs/libcurl/curl_mime_data_cb.md: In function ‘read_callback’:
docs/libcurl/curl_mime_data_cb.md:127:9: error: comparison of integer expressions of different signedness: ‘curl_off_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare]
127 | if(sz > nitems)
| ^
cc1: all warnings being treated as errors
docs/libcurl/curl_ws_recv.md: In function ‘main’:
docs/libcurl/curl_ws_recv.md:100:26: error: comparison of integer expressions of different signedness: ‘curl_off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare]
100 | if(meta->bytesleft > sizeof(buffer) - offset)
| ^
cc1: all warnings being treated as errors
docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md: In function ‘my_trace’:
docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md:158:5: error: this statement may fall through [-Werror=implicit-fallthrough=]
158 | fwrite(data, size, 1, stderr);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md:159:3: note: here
159 | default: /* in case a new one is introduced to shock us */
| ^~~~~~~
cc1: all warnings being treated as errors
Detected problems
```
https://github.com/curl/curl/actions/runs/23293404726/job/67734464484?pr=21006
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.
Also: