From 8f6be016aeacabd9a83d04b123e6bda898196ea2 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 28 Sep 2022 14:33:31 +1000 Subject: cppcheck: Suppress same-value-in-ternary branches warning TIMER_INTERVAL is the minimum of two separately defined intervals which happen to have the same value at present. This results in an expression which has the same value in both branches of a ternary operator, which cppcheck warngs about. This is logically sound in this case, so suppress the error (we appear to already have a similar suppression for clang-tidy). Also add an unmatchedSuppression suppression, since only some cppcheck versions complain about this instance. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- passt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/passt.c b/passt.c index 4796c89..2c4a986 100644 --- a/passt.c +++ b/passt.c @@ -305,6 +305,7 @@ int main(int argc, char **argv) loop: /* NOLINTNEXTLINE(bugprone-branch-clone): intervals can be the same */ + /* cppcheck-suppress [duplicateValueTernary, unmatchedSuppression] */ nfds = epoll_wait(c.epollfd, events, EPOLL_EVENTS, TIMER_INTERVAL); if (nfds == -1 && errno != EINTR) { perror("epoll_wait"); -- cgit v1.2.3