mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-06-15 08:26:08 +08:00
Fix compile error in clang<10: fails on pragma -Wc++20-extensions
This fixes a compile error in all clang versions lower than 10, triggered by the use of the pragma ignore with what is an unknown warning on those compiler versions: ``` /__w/ext/fast_float/include/fast_float/parse_number.h:361:34: error: unknown warning group '-Wc++20-extensions', ignored [-Werror,-Wunknown-pragmas] ``` The fix requires looking at __clang_major__, which is unfortunately different in Apple, so a version dispatch is required.
This commit is contained in:
parent
e0b53eaf63
commit
23e245f2b3
@ -358,7 +358,9 @@ from_chars_float_advanced(UC const *first, UC const *last, T &value,
|
|||||||
// This is unfortunate.
|
// This is unfortunate.
|
||||||
#ifdef __clang__
|
#ifdef __clang__
|
||||||
#pragma clang diagnostic push
|
#pragma clang diagnostic push
|
||||||
|
#if (!defined(__APPLE_CC__) && __clang_major__ >= 10) || (__clang_major__ >= 13)
|
||||||
#pragma clang diagnostic ignored "-Wc++20-extensions"
|
#pragma clang diagnostic ignored "-Wc++20-extensions"
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
if fastfloat_unlikely (pns.too_many_digits) {
|
if fastfloat_unlikely (pns.too_many_digits) {
|
||||||
return parse_number_slow_path<T, UC>(first, last, value, options, bjf);
|
return parse_number_slow_path<T, UC>(first, last, value, options, bjf);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user