[OpenSIPS-Devel] [OpenSIPS/opensips] 5bfe21: Fix curl type warnings: use long instead of int
Peter Lemenkov
noreply at github.com
Mon Oct 27 11:20:23 UTC 2025
Branch: refs/heads/3.5
Home: https://github.com/OpenSIPS/opensips
Commit: 5bfe217346826df75cf7c739cf6f508a79ca0f9a
https://github.com/OpenSIPS/opensips/commit/5bfe217346826df75cf7c739cf6f508a79ca0f9a
Author: Peter Lemenkov <lemenkov at gmail.com>
Date: 2025-10-27 (Mon, 27 Oct 2025)
Changed paths:
M modules/db_http/http_dbase.c
M modules/rest_client/rest_methods.c
M modules/xcap_client/xcap_functions.c
Log Message:
-----------
Fix curl type warnings: use long instead of int
Multiple warnings appear during compilation of modules using libcurl:
```
gcc -fPIC -DPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DMOD_NAME='rest_client' -DPKG_MALLOC -DSHM_MMAP -DUSE_MCAST -DDISABLE_NAGLE -DSTATISTICS -DHAVE_RESOLV_RES -DF_MALLOC -DQ_MALLOC -DHP_MALLOC -DDBG_MALLOC -DF_PARALLEL_MALLOC -DHAVE_STDATOMIC -DHAVE_GENERICS -DNAME='"opensips"' -DVERSION='"3.6.2"' -DARCH='"x86_64"' -DOS='"linux"' -DCOMPILER='"gcc 15"' -D__CPU_x86_64 -D__OS_linux -D__SMP_yes -DCFG_DIR='"/etc/opensips/"' -DVERSIONTYPE='"git"' -DTHISREVISION='"994bcd690"' -DFAST_LOCK -DADAPTIVE_WAIT -DADAPTIVE_WAIT_LOOPS=1024 -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H -DHAVE_TIMEGM -DHAVE_EPOLL -DHAVE_SIGIO_RT -DHAVE_SELECT -c rest_methods.c -o rest_methods.o
rest_methods.c: In function ‘init_transfer’:
rest_methods.c:408:17: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
408 | w_curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, curl_http_version);
| ^
rest_methods.c:422:9: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
422 | w_curl_easy_setopt(handle, CURLOPT_VERBOSE, 1);
| ^
rest_methods.c:424:9: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
424 | w_curl_easy_setopt(handle, CURLOPT_FAILONERROR, 0);
| ^
rest_methods.c: In function ‘set_upload_opts’:
rest_methods.c:480:9: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
480 | w_curl_easy_setopt(handle, CURLOPT_POSTFIELDSIZE, body->len);
| ^
rest_methods.c: In function ‘rest_sync_transfer’:
rest_methods.c:714:17: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
714 | set_post_opts(sync_handle, ctype, body);
| ^
rest_methods.c: In function ‘start_async_http_req’:
rest_methods.c:847:17: warning: call to ‘Wcurl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument [-Wattribute-warning]
847 | set_post_opts(handle, req_ctype, req_body);
| ^
rest_methods.c:918:25: warning: call to ‘Wcurl_easy_getinfo_err_long’ declared with attribute warning: curl_easy_getinfo expects a pointer to long [-Wattribute-warning]
918 | curl_easy_getinfo(handle, CURLINFO_RESPONSE_CODE, &http_rc);
| ^
```
Let's ensure we pass a literals and variables with a proper type.
Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
(cherry picked from commit 2a03d51f7452b78e603ffb42bb32c815e27c078a)
To unsubscribe from these emails, change your notification settings at https://github.com/OpenSIPS/opensips/settings/notifications
More information about the Devel
mailing list