I would suggest that you define cds_list_for_each_entry_rcu(A,B,C) somehow. Somehow.. use a for loop..
I can't suggest anything specific because I don't know what the variables are and how they are used in the code.
If that makes the macro definition easier.. I believe you can expand it to a c++ range for loop , as far as I know Cppcheck should treat that the same in C code.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How can I tell cppcheck that "LIST_FOREACH(...)" and "cds_list_for_each_entry_rcu(...)" are loops rather than function calls?
eg, the code below reports some false positives which do not appear when "cds_list_for_each_entry_rcu" is replaced with "for":
c.c:7:31: style: Condition '!primary' is always true [knownConditionTrueFalse]
if (!primary)
^
c.c:3:31: note: Assignment 'primary=0', assigned value is 0
in_addr_t primary = 0;
^
c.c:7:31: note: Condition '!primary' is always true
if (!primary)
^
@danielmarjamaki any thoughts on this? Thanks.
I would suggest that you define
cds_list_for_each_entry_rcu(A,B,C)somehow. Somehow.. use a for loop..I can't suggest anything specific because I don't know what the variables are and how they are used in the code.
If that makes the macro definition easier.. I believe you can expand it to a c++ range for loop , as far as I know Cppcheck should treat that the same in C code.