From 3153f5011794f5bb1b25821a664217e29076f381 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Mon, 24 Jun 2024 16:16:52 -0700 Subject: [PATCH] Use C++17 [[fallthrough]] in 1 file inc ../xplat/hermes/external/dtoa/dtoa.inc Reviewed By: dmm-fb Differential Revision: D58818992 fbshipit-source-id: 53ba3f0491163cfbf2c6d7b2774ed0a16640b67f --- external/dtoa/dtoa.inc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/external/dtoa/dtoa.inc b/external/dtoa/dtoa.inc index aac1a63d497..0db9c6841be 100644 --- a/external/dtoa/dtoa.inc +++ b/external/dtoa/dtoa.inc @@ -32,6 +32,17 @@ * calculation. */ +#if defined __has_attribute + #if __has_attribute(fallthrough) + #define FALLTHROUGH __attribute__ ((fallthrough)) + #else + #define FALLTHROUGH (void)0 + #endif +#else + #define FALLTHROUGH (void)0 +#endif + + char * g_dtoa #ifdef KR_headers @@ -274,7 +285,7 @@ g_dtoa break; case 2: leftright = 0; - /* no break */ + FALLTHROUGH; case 4: if (ndigits <= 0) ndigits = 1; @@ -282,7 +293,7 @@ g_dtoa break; case 3: leftright = 0; - /* no break */ + FALLTHROUGH; case 5: i = ndigits + k + 1; ilim = i;