From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by passt.top (Postfix, from userid 1000) id 129865A0620; Thu, 07 Nov 2024 19:43:31 +0100 (CET) From: Stefano Brivio To: passt-dev@passt.top Subject: [PATCH 5/6] passt: Use NOLINT clang-tidy block instead of NOLINTNEXTLINE Date: Thu, 7 Nov 2024 19:43:30 +0100 Message-ID: <20241107184331.3164784-6-sbrivio@redhat.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241107184331.3164784-1-sbrivio@redhat.com> References: <20241107184331.3164784-1-sbrivio@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: W63L643VVQFVCZ2RHJZZ4YEYYOZNOP2E X-Message-ID-Hash: W63L643VVQFVCZ2RHJZZ4YEYYOZNOP2E X-MailFrom: sbrivio@passt.top X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: For some reason, this is only reported by clang-tidy 19.1.2 on Alpine: /home/sbrivio/passt/passt.c:314:53: error: conditional operator with identical true and false expressions [bugprone-branch-clone,-warnings-as-errors] 314 | nfds = epoll_wait(c.epollfd, events, EPOLL_EVENTS, TIMER_INTERVAL); | ^ We do have a suppression, but not on the line preceding it, because we also need a cppcheck suppression there. Use NOLINTBEGIN/NOLINTEND for the clang-tidy suppression. Signed-off-by: Stefano Brivio --- passt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passt.c b/passt.c index eaf231d..fac6101 100644 --- a/passt.c +++ b/passt.c @@ -309,9 +309,10 @@ int main(int argc, char **argv) timer_init(&c, &now); loop: - /* NOLINTNEXTLINE(bugprone-branch-clone): intervals can be the same */ + /* NOLINTBEGIN(bugprone-branch-clone): intervals can be the same */ /* cppcheck-suppress [duplicateValueTernary, unmatchedSuppression] */ nfds = epoll_wait(c.epollfd, events, EPOLL_EVENTS, TIMER_INTERVAL); + /* NOLINTEND(bugprone-branch-clone) */ if (nfds == -1 && errno != EINTR) die_perror("epoll_wait() failed in main loop"); -- 2.43.0