diff --git a/yoga/style/StyleLength.h b/yoga/style/StyleLength.h index 01e69718b2..8099ce7df4 100644 --- a/yoga/style/StyleLength.h +++ b/yoga/style/StyleLength.h @@ -74,7 +74,14 @@ class StyleLength { } constexpr FloatOptional resolve(float referenceLength) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif switch (unit_) { +#ifdef __clang__ +#pragma clang diagnostic pop +#endif case Unit::Point: return value_; case Unit::Percent: diff --git a/yoga/style/StyleSizeLength.h b/yoga/style/StyleSizeLength.h index 8dc4f24013..fc4d371e42 100644 --- a/yoga/style/StyleSizeLength.h +++ b/yoga/style/StyleSizeLength.h @@ -99,7 +99,14 @@ class StyleSizeLength { } constexpr FloatOptional resolve(float referenceLength) { +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wswitch-enum" +#endif switch (unit_) { +#ifdef __clang__ +#pragma clang diagnostic pop +#endif case Unit::Point: return value_; case Unit::Percent: