Skip to content

Fix compile error in clang<10: fails on pragma -Wc++20-extensions#388

Merged
lemire merged 1 commit into
fastfloat:mainfrom
biojppm:fix/clang_compile_error
Jun 8, 2026
Merged

Fix compile error in clang<10: fails on pragma -Wc++20-extensions#388
lemire merged 1 commit into
fastfloat:mainfrom
biojppm:fix/clang_compile_error

Conversation

@biojppm

@biojppm biojppm commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This fixes a compile error introduced in #387.

The error happens in all clang versions below 10, and is triggered by the use of the pragma ignore with what is an unknown warning on those compilers:

parse_number.h:361:34: error: unknown warning group '-Wc++20-extensions'

The fix requires looking at __clang_major__, which is unfortunately different in Apple, so a version dispatch is required.

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.
@lemire lemire merged commit c05156f into fastfloat:main Jun 8, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants