Skip to content

Commit e0c6b11

Browse files
committed
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 <[email protected]> Co-authored-by: Lumynous <[email protected]> Change-Id: I12575573258acbd13df05be86d05ca42251cabe6
1 parent 2bda9b9 commit e0c6b11

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

list.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ static inline void list_move_tail(struct list_head *node,
416416
* works in the same way as BUILD_BUG_ON_ZERO macro of Linux kernel.
417417
*/
418418
#define list_for_each_entry(entry, head, member) \
419-
for (entry = (void *) 1; sizeof(struct { int : -1; }); ++(entry))
419+
for (entry = (void *) 1; sizeof(struct { int i : -1; }); ++(entry))
420420
#endif
421421

422422
/**
@@ -457,8 +457,8 @@ static inline void list_move_tail(struct list_head *node,
457457
&entry->member != (head); entry = safe, \
458458
safe = list_entry(safe->member.next, typeof(*entry), member))
459459
#else
460-
#define list_for_each_entry_safe(entry, safe, head, member) \
461-
for (entry = safe = (void *) 1; sizeof(struct { int : -1; }); \
460+
#define list_for_each_entry_safe(entry, safe, head, member) \
461+
for (entry = (void *) 1; sizeof(struct { int i : -1; }); \
462462
++(entry), ++(safe))
463463
#endif
464464

scripts/checksums

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
db6784ff3917888db4d1dceaa0570d99ed40e762 queue.h
2-
27d7a57c6bab59beda9178f240db1aa7c0062361 list.h
2+
9be9666430f392924f5d27caa71a412527bf9267 list.h
33
3bb0192cee08d165fd597a9f6fbb404533e28fcf scripts/check-commitlog.sh

0 commit comments

Comments
 (0)