← Commit list

31add10322

Viktor Szakats
Viktor Szakats
2026-03-19
SUCCESS Duration: 250s

Subject

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

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.github/scripts/verify-examples.pl+1 -1
@@ -37,7 +37,7 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
- my $rc = system("gcc -c test.c -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION -Wunused -Werror -Wall -Wno-unused-but-set-variable -I include") >> 8;
+ my $rc = system("gcc -c test.c -I include -W -Wall -pedantic -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_DEPRECATION") >> 8;
return $rc;
}
.github/scripts/verify-synopsis.pl+1 -1
@@ -35,7 +35,7 @@ if(!@files || $files[0] eq "-h") {
}
sub testcompile {
- my $rc = system("gcc -c test.c -DCURL_DISABLE_TYPECHECK -DCURL_ALLOW_OLD_MULTI_SOCKET -I include") >> 8;
+ my $rc = system("gcc -c test.c -I include -W -Wall -pedantic -Werror -DCURL_ALLOW_OLD_MULTI_SOCKET -DCURL_DISABLE_TYPECHECK") >> 8;
return $rc;
}
docs/libcurl/curl_mime_data_cb.md+1 -1
@@ -121,7 +121,7 @@ struct ctl {
size_t read_callback(char *buffer, size_t size, size_t nitems, void *arg)
{
struct ctl *p = (struct ctl *)arg;
- curl_off_t sz = p->size - p->position;
+ size_t sz = (size_t)(p->size - p->position);
nitems *= size;
if(sz > nitems)
docs/libcurl/curl_ws_recv.md+1 -1
@@ -97,7 +97,7 @@ int main(void)
if(result == CURLE_OK) {
if(meta->bytesleft == 0)
break; /* finished receiving */
- if(meta->bytesleft > sizeof(buffer) - offset)
+ if(meta->bytesleft > (curl_off_t)(sizeof(buffer) - offset))
result = CURLE_TOO_LARGE;
}
docs/libcurl/opts/CURLOPT_DEBUGFUNCTION.md+6 -7
@@ -111,9 +111,8 @@ NULL
# EXAMPLE
~~~c
-static
-void dump(const char *text,
- FILE *stream, unsigned char *ptr, size_t size)
+static void dump(const char *text,
+ FILE *stream, unsigned char *ptr, size_t size)
{
size_t i;
size_t c;
@@ -143,10 +142,9 @@ void dump(const char *text,
}
}
-static
-int my_trace(CURL *handle, curl_infotype type,
- char *data, size_t size,
- void *clientp)
+static int my_trace(CURL *handle, curl_infotype type,
+ char *data, size_t size,
+ void *clientp)
{
const char *text;
(void)handle;
@@ -156,6 +154,7 @@ int my_trace(CURL *handle, curl_infotype type,
case CURLINFO_TEXT:
fputs("== Info: ", stderr);
fwrite(data, size, 1, stderr);
+ return 0;
default: /* in case a new one is introduced to shock us */
return 0;