Repository navigation
Silence -Wc++20-extensions at the remaining [[unlikely]] sites - #430
Conversation
…astfloat#427) The javascript early-exit checks added in b2e41e8 use fastfloat_unlikely without the point-of-use clang diagnostic guard that the other call sites have (see fastfloat#387), so clang with -pedantic in C++11/14/17 mode warns "use of the 'unlikely' attribute is a C++20 extension". Wrap both sites with the same guarded pragma push/pop already used in parse_number.h and decimal_to_binary.h. No change to code generation. Add a CI step compiling fast_float.h with clang-14 and -pedantic-errors -Werror in C++11/14/17/20 to catch regressions.
|
@CODER-7777 I consider that it is a bug in clang and should be reported accordingly. |
|
They'd close it as a dup of llvm/llvm-project#32865 Edit: actually there was a much more recent one which I can't find right now. But they like how it works anyway |
|
@jwakely Do you have a recommendation? |
|
As a GCC dev ... stick to GCC? 😉 No serious suggestions, sorry - the ugly pragmas seem like a necessary evil |
|
Thanks both. I checked llvm/llvm-project#32865: Clang decided to keep |
|
Can you please give me any suggestion @lemire on this failing check? It seems to be an issue of the network ? |
|
Independent AI-assisted check with Ubuntu Clang 14.0.6 supports I also applied only the two header hunks to All 26 expected outcomes matched, including deliberate rejection controls. This was syntax-only compilation of exact header exports, not a full test suite, CI or performance check. No competing patch/PR. |
Fixes #427
The javascript early-exit checks added in b2e41e8 (
parse_number.h,ascii_number.h) usefastfloat_unlikelywithout the point-of-use clang diagnostic guard that the other[[unlikely]]sites have (approach chosen in #387, see discussion). So clang in C++11/14/17 mode with-pedanticwarnsuse of the 'unlikely' attribute is a C++20 extension.#pragma clang diagnosticpush/pop already used inparse_number.handdecimal_to_binary.h.__has_cpp_attributelogic infloat_common.hunchanged (unlike Guard [[unlikely]] attribute use with C++20 language check #428).fast_float.hwith-pedantic-errors -Werrorin C++11/14/17/20.Pragmas only affect diagnostics, so code generation is unchanged and there is no performance claim. Tested with the full test suite under clang 14 (C++11 and C++20,
-Werror).