mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-26 12:41:22 +03:00
Ubuntu 26.04.1: Fix new compiler warnings
Update pre-commit versions as well.
This commit is contained in:
1 parent
c63c8f7cb7
commit
75a532c1f7
6 files changed
+30
-25
No files matched your search
@@ -1,6 +1,6 @@
|
||||
repos:
|
||||
- repo: https://github.com/igrr/astyle_py.git
|
||||
rev: v1.0.5
|
||||
rev: v1.1.0
|
||||
hooks:
|
||||
- id: astyle_py
|
||||
files: '^.*\.(c|cpp|cxx|h|h.in|h.riot|h.riot.in|h.windows|h.windows.in|h.contiki|hpp|inc)$'
|
||||
@@ -24,7 +24,7 @@ repos:
|
||||
'--unpad-paren']
|
||||
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.3.0
|
||||
rev: v6.0.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
exclude: 'tests/oss-fuzz/.*_seed_corpus/.*$'
|
||||
@@ -32,7 +32,7 @@ repos:
|
||||
exclude: 'tests/oss-fuzz/.*_seed_corpus/.*$'
|
||||
- id: check-merge-conflict
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
rev: v2.4.3
|
||||
hooks:
|
||||
- id: codespell
|
||||
exclude: 'tests/oss-fuzz/.*_seed_corpus/.*$|examples/etsi_iot_01_largedata.txt|AUTHORS|examples/riot/Makefile'
|
||||
@@ -25,7 +25,7 @@ USE_LWIP_CONTRIB := $(shell if [ $(WITH_LWIP_BRANCH) = "STABLE-2_1_3_RELEASE" ]
|
||||
fi)
|
||||
|
||||
# Update to latest TinyDTLS submodule as defined for libcoap
|
||||
WITH_TINYDTLS_BRANCH=c6a209f689a225655534249e79103558aa8656e6
|
||||
WITH_TINYDTLS_BRANCH=f009bc82283e847905490d84e3f3cfc7ee6cc447
|
||||
|
||||
# Need to determine which library clock_gettime() resides in (as found by ./autogen.sh)
|
||||
LDLIBS := $(shell if [ -f $(libcoap_dir)/config.log ] ; then \
|
||||
|
||||
+1
-1
Submodule ext/tinydtls updated: c6a209f689...f009bc8228.
+22
-17
@@ -365,15 +365,16 @@ decode_synopsis_definition(FILE *fpheader, const char *buffer, int in_synopsis)
|
||||
(outbuf[len-3] == '*' && outbuf[len-2] == ';'))) {
|
||||
if (!is_inline_func && !is_void_func && !is_number_func && !is_struct_func && !is_struct &&
|
||||
!is_ptr) {
|
||||
char *lcp = strchr(buffer, ' ');
|
||||
const char *lcp = strchr(buffer, ' ');
|
||||
|
||||
if (lcp)
|
||||
*lcp = '\000';
|
||||
fprintf(stderr,
|
||||
"man/examples-code-check.c: Function return type '%s' undefined in pointer_list[] or number_list[]\n",
|
||||
&buffer[1]);
|
||||
if (lcp)
|
||||
*lcp = ' ';
|
||||
fprintf(stderr,
|
||||
"man/examples-code-check.c: Function return type '%*.*s' undefined in pointer_list[] or number_list[]\n",
|
||||
(int)(lcp - buffer), (int)(lcp - buffer), &buffer[1]);
|
||||
else
|
||||
fprintf(stderr,
|
||||
"man/examples-code-check.c: Function return type '%s' undefined in pointer_list[] or number_list[]\n",
|
||||
&buffer[1]);
|
||||
exit_code = 1;
|
||||
}
|
||||
if (is_inline_func) {
|
||||
@@ -401,43 +402,47 @@ decode_synopsis_definition(FILE *fpheader, const char *buffer, int in_synopsis)
|
||||
}
|
||||
cleanup:
|
||||
if (in_synopsis && func_start) {
|
||||
char *wcp = strchr(func_start, '(');
|
||||
const char *wcp = strchr(func_start, '(');
|
||||
char tmpbuf[99];
|
||||
|
||||
if (!wcp && is_struct)
|
||||
wcp = strchr(func_start, ';');
|
||||
if (!wcp) {
|
||||
wcp = strchr(func_start, '\n');
|
||||
if (wcp)
|
||||
*wcp = '\000';
|
||||
fprintf(stderr, "SYNOPSIS: function %s issue\n", func_start);
|
||||
fprintf(stderr, "SYNOPSIS: function %*.*s issue\n", (int)(wcp - func_start),
|
||||
(int)(wcp - func_start), func_start);
|
||||
else
|
||||
fprintf(stderr, "SYNOPSIS: function %s issue\n", func_start);
|
||||
return;
|
||||
}
|
||||
*wcp = '\000';
|
||||
snprintf(tmpbuf, sizeof(tmpbuf), "%*.*s", (int)(wcp - func_start), (int)(wcp - func_start),
|
||||
func_start);
|
||||
for (i = 0; i < name_cnt; i++) {
|
||||
if (strcmp(name_list[i], func_start) == 0) {
|
||||
if (strcmp(name_list[i], tmpbuf) == 0) {
|
||||
name_list[i][0] = '\000';
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == name_cnt) {
|
||||
fprintf(stderr, "SYNOPSIS: %s not in NAME\n", func_start);
|
||||
fprintf(stderr, "SYNOPSIS: %s not in NAME\n", tmpbuf);
|
||||
exit_code = 1;
|
||||
}
|
||||
if (!is_void_func && !is_struct) {
|
||||
for (i = 0; i < return_cnt; i++) {
|
||||
if (strcmp(func_start, return_list[i]) == 0) {
|
||||
fprintf(stderr, "SYNOPSIS: %s duplicated\n", func_start);
|
||||
if (strcmp(tmpbuf, return_list[i]) == 0) {
|
||||
fprintf(stderr, "SYNOPSIS: %s duplicated\n", tmpbuf);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i != return_cnt)
|
||||
return;
|
||||
if (i >= (int)(sizeof(return_list)/sizeof(return_list[0]))) {
|
||||
fprintf(stderr, "SYNOPSIS: %s insufficient space (%u >= %u)\n", func_start,
|
||||
fprintf(stderr, "SYNOPSIS: %s insufficient space (%u >= %u)\n", tmpbuf,
|
||||
i, (int)(sizeof(return_list)/sizeof(return_list[0])));
|
||||
return;
|
||||
}
|
||||
strncpy(return_list[i], func_start, sizeof(return_list[i])-1);
|
||||
strncpy(return_list[i], tmpbuf, sizeof(return_list[i])-1);
|
||||
return_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ match(const coap_str_const_t *text, const coap_str_const_t *pattern,
|
||||
while (remaining_length) {
|
||||
size_t token_length;
|
||||
const uint8_t *token = next_token;
|
||||
next_token = (unsigned char *)memchr(token, ' ', remaining_length);
|
||||
next_token = (const unsigned char *)memchr(token, ' ', remaining_length);
|
||||
|
||||
if (next_token) {
|
||||
token_length = next_token - token;
|
||||
|
||||
+2
-2
@@ -1331,8 +1331,8 @@ ec_abstract_pkcs8_asn1(const uint8_t *asn1_ptr, size_t asn1_length) {
|
||||
|
||||
static coap_binary_t *
|
||||
pem_decode_mem_asn1(const char *begstr, const uint8_t *str) {
|
||||
char *bcp = str ? strstr((const char *)str, begstr) : NULL;
|
||||
char *tcp = bcp ? strstr(bcp, "-----END ") : NULL;
|
||||
const char *bcp = str ? strstr((const char *)str, begstr) : NULL;
|
||||
const char *tcp = bcp ? strstr(bcp, "-----END ") : NULL;
|
||||
|
||||
if (bcp && tcp) {
|
||||
bcp += strlen(begstr);
|
||||
|
||||
Reference in new issue
Block a user