If you build first example from readme with flags:
-std=c++20 -fsanitize=address -fno-rtti
And run bench test. You will get report from sanitizer about READ on zero page address.
Caused by this source line:
|
os.imbue(std::locale(os.getloc(), new NumSep(','))); |
Seems that std::locale call under -fno-rtti is triggering this problem. I found simmilar issue on stack overflow c-locale-without-rtti
Reproducible on https://godbolt.org/z/qYfMbsjG3
I didn't found in documentation that nanobench requires rtti to be running properly. And it would be nice not to get ub when rtti is disabled.
As workaround rtti can be just enabled for bench tests alone, but this can in theory affect results.
If you build first example from readme with flags:
And run bench test. You will get report from sanitizer about READ on zero page address.
Caused by this source line:
nanobench/src/include/nanobench.h
Line 2815 in e432789
Seems that std::locale call under -fno-rtti is triggering this problem. I found simmilar issue on stack overflow c-locale-without-rtti
Reproducible on https://godbolt.org/z/qYfMbsjG3
I didn't found in documentation that nanobench requires rtti to be running properly. And it would be nice not to get ub when rtti is disabled.
As workaround rtti can be just enabled for bench tests alone, but this can in theory affect results.