Skip to content

docs: enable more compiler warnings for C snippets, fix 3 finds#21006

Closed
vszakats wants to merge 6 commits intocurl:masterfrom
vszakats:docweverything
Closed

docs: enable more compiler warnings for C snippets, fix 3 finds#21006
vszakats wants to merge 6 commits intocurl:masterfrom
vszakats:docweverything

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Mar 19, 2026

Also:

  • sync gcc option order.
  • unfold lines in C snippet.

@github-actions github-actions Bot added documentation CI Continuous Integration script labels Mar 19, 2026
```
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
@vszakats vszakats changed the title [TEST] run -Weverything through docs C snippets docs: enable more compiler warnings for C snippets, fix 3 hits Mar 19, 2026
@vszakats vszakats changed the title docs: enable more compiler warnings for C snippets, fix 3 hits docs: enable more compiler warnings for C snippets, fix 3 finds Mar 19, 2026
@vszakats vszakats closed this in 31add10 Mar 19, 2026
@vszakats vszakats deleted the docweverything branch March 19, 2026 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

1 participant