https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125228
--- Comment #6 from dragon-archer at outlook dot com ---
(In reply to Jonathan Wakely from comment #4)
> We could do this so that Ryu assertions are only used when the libstdc++
> assertions are also enabled:
>
> --- a/libstdc++-v3/src/c++17/floating_to_chars.cc
> +++ b/libstdc++-v3/src/c++17/floating_to_chars.cc
> @@ -106,6 +106,9 @@ namespace
>
> namespace ryu
> {
> +#ifndef _GLIBCXX_ASSERTIONS
> +# define NDEBUG
> +#endif
> #include "ryu/common.h"
> #include "ryu/digit_table.h"
> #include "ryu/d2s_intrinsics.h"
`#define NDEBUG` here is useless, you should define it before `#include
<cassert>`.
BTW, I recommend to replace `assert` with `__glibcxx_assert` directly and
remove `#include <cassert>`, which should be clearer. I've generated a patch
for this above.