From e0c6b113c9c9404208dcf4dccf4d229016aa4778 Mon Sep 17 00:00:00 2001 From: Jim Huang Date: Sat, 1 Mar 2025 19:25:03 +0000 Subject: [PATCH] Suppress Cppcheck "unused label" warnings The commit 1d68fae introduced an anonymous bit field, which triggers a false positive in Cppcheck 2.13.0 (provided by Ubuntu 24.04): "Label 'int' is not used. [unusedLabel]". Although newer versions of Cppcheck resolve this issue, version 2.13 is still preferable for minimal development environment changes. Instead of switching versions, this commit drops the anonymous bit field to prevent the Cppcheck warning. Reported-by: backink Co-authored-by: Lumynous Change-Id: I12575573258acbd13df05be86d05ca42251cabe6 --- list.h | 6 +++--- scripts/checksums | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/list.h b/list.h index 065ab3dc9..1176e3ce4 100644 --- a/list.h +++ b/list.h @@ -416,7 +416,7 @@ static inline void list_move_tail(struct list_head *node, * works in the same way as BUILD_BUG_ON_ZERO macro of Linux kernel. */ #define list_for_each_entry(entry, head, member) \ - for (entry = (void *) 1; sizeof(struct { int : -1; }); ++(entry)) + for (entry = (void *) 1; sizeof(struct { int i : -1; }); ++(entry)) #endif /** @@ -457,8 +457,8 @@ static inline void list_move_tail(struct list_head *node, &entry->member != (head); entry = safe, \ safe = list_entry(safe->member.next, typeof(*entry), member)) #else -#define list_for_each_entry_safe(entry, safe, head, member) \ - for (entry = safe = (void *) 1; sizeof(struct { int : -1; }); \ +#define list_for_each_entry_safe(entry, safe, head, member) \ + for (entry = (void *) 1; sizeof(struct { int i : -1; }); \ ++(entry), ++(safe)) #endif diff --git a/scripts/checksums b/scripts/checksums index 3495f023a..cbfc6e1aa 100644 --- a/scripts/checksums +++ b/scripts/checksums @@ -1,3 +1,3 @@ db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h -27d7a57c6bab59beda9178f240db1aa7c0062361 list.h +9be9666430f392924f5d27caa71a412527bf9267 list.h 3bb0192cee08d165fd597a9f6fbb404533e28fcf scripts/check-commitlog.sh