From 6e300f3a7e540e2ac52ee1546dc125a3cb70d7c3 Mon Sep 17 00:00:00 2001 From: Nikolay Beloborodov Date: Wed, 16 Oct 2024 18:23:20 -0700 Subject: [PATCH] fix folly sdt macro linter problems Summary: Fix folly sdt macro linter problems. Have a look at this diff D63853656. Previous changes to FOLLY_SDT macro introduced lint problems at some projects. avoid do-while loops fbcode/folly/tracing/StaticTracepoint.h:36:3: expanded from macro 'FOLLY_SDT_WITH_SEMAPHORE' fbcode/folly/tracing/StaticTracepoint-ELF.h:191:3: expanded from macro 'FOLLY_SDT_PROBE_N' fbcode/folly/tracing/StaticTracepoint-ELF.h:174:3: expanded from macro 'FOLLY_SDT_PROBE' The do-while was introduced here D61148295. Reviewed By: ot Differential Revision: D64329871 fbshipit-source-id: c670a4ee6c3a9c1a84f60e20c0c7654893f65eb3 --- folly/tracing/StaticTracepoint-ELF.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/folly/tracing/StaticTracepoint-ELF.h b/folly/tracing/StaticTracepoint-ELF.h index ad8c4c35bca..582eb9973b6 100644 --- a/folly/tracing/StaticTracepoint-ELF.h +++ b/folly/tracing/StaticTracepoint-ELF.h @@ -170,6 +170,7 @@ FOLLY_SDT_ASM_1( .endif) // Main probe Macro. +// NOLINTBEGIN(cppcoreguidelines-avoid-do-while) #define FOLLY_SDT_PROBE(provider, name, has_semaphore, n, arglist) \ do { \ __asm__ __volatile__ ( \ @@ -182,6 +183,7 @@ FOLLY_SDT_BASE_CONTENT \ ); \ } while (0) +// NOLINTEND(cppcoreguidelines-avoid-do-while) // Helper Macros to handle variadic arguments. #define FOLLY_SDT_NARG_(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) N