Fix compilation warnings with gcc 14

This commit is contained in:
Vivek Kumar Dutta 2025-12-22 11:11:11 +05:30
parent e672f84d95
commit fc34f19ec5
No known key found for this signature in database
GPG key ID: 4E09F5AD8265FD4C
6 changed files with 12 additions and 15 deletions

View file

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0...3.5)
cmake_minimum_required(VERSION 3.0...3.10)
PROJECT(icwmp C)

View file

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.0...3.5)
PROJECT(libcwmpdm.so)
ADD_DEFINITIONS(-Wall -Werror -Wformat -g)

View file

@ -1,5 +1,3 @@
cmake_minimum_required(VERSION 3.0...3.5)
PROJECT(icwmpd)
ADD_DEFINITIONS(-Wall -Werror -Wformat -g)

View file

@ -38,7 +38,7 @@ static bool curl_glob_init = false;
void http_set_timeout(void)
{
if (curl)
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1);
curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, 1L);
}
int icwmp_http_client_init()
@ -114,8 +114,8 @@ static void http_set_security_options()
}
if (cwmp_ctx.conf.insecure_enable) {
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)false);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
}
if (CWMP_STRLEN(cwmp_ctx.conf.cpe_client_cert) != 0 && file_exists(cwmp_ctx.conf.cpe_client_cert) &&
@ -134,8 +134,8 @@ static void http_set_connection_options()
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 5L);
curl_easy_setopt(curl, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
curl_easy_setopt(curl, CURLOPT_POSTREDIR, (long)CURL_REDIR_POST_ALL);
curl_easy_setopt(curl, CURLOPT_NOBODY, 0L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, cwmp_ctx.net.ip_resolve);
@ -259,7 +259,7 @@ static void http_set_inout_options(char *msg_out, int msg_out_len, char **msg_in
if (msg_out)
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long)msg_out_len);
else
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0);
curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, 0L);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, http_get_response);
curl_easy_setopt(curl, CURLOPT_WRITEDATA, msg_in);
@ -500,7 +500,8 @@ static void http_cr_new_client(int client, bool service_available)
*/
size_t avail_space = (size_t)(sizeof(data) - strlen(data));
if (buf_len < avail_space) {
strncat(data, buffer, buf_len);
//strncat(data, buffer, buf_len);
snprintf(data+strlen(data), avail_space, "%s", buffer);
}
}

View file

@ -17,7 +17,7 @@
#include "common.h"
#define HTTP_TIMEOUT 60
#define HTTP_TIMEOUT 60L
void http_set_timeout(void);

View file

@ -126,9 +126,9 @@ static long upload_file(const char *file_path, const char *url, const char *user
}
if (CWMP_STRNCMP(url, "https://", 8) == 0)
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, false);
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, (long)false);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, CURL_TIMEOUT);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)CURL_TIMEOUT);
curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50L);
curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_ANY);