From b3614254ae00c767a66f332e3044f1bf5e578b46 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 7 Mar 2026 16:44:48 +0100 Subject: [PATCH] silence globally --- include/curl/curl.h | 7 +++++-- include/curl/urlapi.h | 3 ++- lib/strerror.c | 2 ++ tests/test1119.pl | 4 +++- tests/test1477.pl | 2 +- 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/include/curl/curl.h b/include/curl/curl.h index 6961a6c4c1..0514bf57dd 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -516,6 +516,7 @@ typedef int (*curl_prereq_callback)(void *clientp, */ typedef enum { + CURLE_SIGNED = -1, /* to ensure signed type, never use! */ CURLE_OK = 0, CURLE_UNSUPPORTED_PROTOCOL, /* 1 */ CURLE_FAILED_INIT, /* 2 */ @@ -2605,7 +2606,8 @@ struct curl_forms { * ***************************************************************************/ typedef enum { - CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, ""), /* 1st, no error */ + CURL_FORMADD_SIGNED = -1, /* to ensure signed type, never use! */ + CURL_FORMADD_OK CURL_DEPRECATED(7.56.0, "") = 0, /* 1st, no error */ CURL_FORMADD_MEMORY CURL_DEPRECATED(7.56.0, ""), CURL_FORMADD_OPTION_TWICE CURL_DEPRECATED(7.56.0, ""), @@ -3055,7 +3057,8 @@ typedef void (*curl_unlock_function)(CURL *handle, void *userptr); typedef enum { - CURLSHE_OK, /* all is fine */ + CURLSHE_SIGNED = -1, /* to ensure signed type, never use! */ + CURLSHE_OK = 0, /* all is fine */ CURLSHE_BAD_OPTION, /* 1 */ CURLSHE_IN_USE, /* 2 */ CURLSHE_INVALID, /* 3 */ diff --git a/include/curl/urlapi.h b/include/curl/urlapi.h index b1f3a2316b..fb633871a5 100644 --- a/include/curl/urlapi.h +++ b/include/curl/urlapi.h @@ -32,7 +32,8 @@ extern "C" { /* the error codes for the URL API */ typedef enum { - CURLUE_OK, + CURLUE_SIGNED = -1, /* to ensure signed type, never use! */ + CURLUE_OK = 0, CURLUE_BAD_HANDLE, /* 1 */ CURLUE_BAD_PARTPOINTER, /* 2 */ CURLUE_MALFORMED_INPUT, /* 3 */ diff --git a/lib/strerror.c b/lib/strerror.c index 1e97c2829d..5fb0bd341d 100644 --- a/lib/strerror.c +++ b/lib/strerror.c @@ -404,6 +404,7 @@ const char *curl_share_strerror(CURLSHcode error) case CURLSHE_NOT_BUILT_IN: return "Feature not enabled in this library"; + case CURLSHE_SIGNED: case CURLSHE_LAST: break; } @@ -517,6 +518,7 @@ const char *curl_url_strerror(CURLUcode error) case CURLUE_TOO_LARGE: return "A value or data field is larger than allowed"; + case CURLUE_SIGNED: case CURLUE_LAST: break; } diff --git a/tests/test1119.pl b/tests/test1119.pl index 9004696f6f..8db19ef6c0 100755 --- a/tests/test1119.pl +++ b/tests/test1119.pl @@ -179,8 +179,10 @@ for my $e (sort @syms) { # *_LAST and *_LASTENTRY are just suffix for the placeholders used for the # last entry in many enum series. # + # *_SIGNED is a suffix to make enums a signed type. + # - if($e =~ /(OBSOLETE|CURLE_RESERVED|^CURL_EXTERN|^CURLINC_|_LAST\z|_LASTENTRY\z|^CURL_TEMP_)/) { + if($e =~ /(OBSOLETE|CURLE_RESERVED|^CURL_EXTERN|^CURLINC_|_LAST\z|_LASTENTRY\z|_SIGNED\z|^CURL_TEMP_)/) { $ignored++; next; } diff --git a/tests/test1477.pl b/tests/test1477.pl index 6a4476bee1..4fe8c3ad3f 100755 --- a/tests/test1477.pl +++ b/tests/test1477.pl @@ -49,7 +49,7 @@ sub scanheader { $line++; if($_ =~ /^ (CURL(E|UE|SHE|HE|M)_[A-Z0-9_]*)/) { my ($name)=($1); - if(($name !~ /(OBSOLETE|CURLE_RESERVED)/) && ($name !~ /_LAST\z/)) { + if(($name !~ /(OBSOLETE|CURLE_RESERVED)/) && ($name !~ /(_LAST|_SIGNED)\z/)) { push @hnames, $name; if($wherefrom{$name}) { print STDERR "double: $name\n";