Skip to content

Commit

Permalink
fix folly sdt macro linter problems
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sonntex authored and facebook-github-bot committed Oct 17, 2024
1 parent afbcf6e commit 6e300f3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions folly/tracing/StaticTracepoint-ELF.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ ( \
Expand All @@ -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
Expand Down

0 comments on commit 6e300f3

Please sign in to comment.