Skip to content

Commit 199b6ff

Browse files
committed
Disable detect_odr_violation for ASan
There's some unfortunate ODR violations that get dianosed with GCC but not Clang for static inline constexpr variables defined inside the class body: template<typename T> struct static_const { static JSON_INLINE_VARIABLE constexpr T value{}; }; This can be ignored pretty much. There is the same problem for std::piecewise_construct: http://lists.boost.org/Archives/boost/2007/06/123353.php ==2455704==ERROR: AddressSanitizer: odr-violation (0x7efddc460e20): [1] size=1 'value' /nix/store/235hvgzcbl06fxy53515q8sr6lljvf68-nlohmann_json-3.11.3/include/nlohmann/detail/meta/cpp_future.hpp:156:45 in /nix/store/pkmljfq97a83dbanr0n64zbm8cyhna33-nix-store-2.33.0pre/lib/libnixstore.so.2.33.0 [2] size=1 'value' /nix/store/235hvgzcbl06fxy53515q8sr6lljvf68-nlohmann_json-3.11.3/include/nlohmann/detail/meta/cpp_future.hpp:156:45 in /nix/store/gbjpkjj0g8vk20fzlyrwj491gwp6g1qw-nix-util-2.33.0pre/lib/libnixutil.so.2.33.0
1 parent 711e738 commit 199b6ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nix-meson-build-support/common/asan-options/asan-options.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ extern "C" [[gnu::retain, gnu::weak]] const char * __asan_default_options()
22
{
33
// We leak a bunch of memory knowingly on purpose. It's not worthwhile to
44
// diagnose that memory being leaked for now.
5-
return "abort_on_error=1:print_summary=1:detect_leaks=0";
5+
return "abort_on_error=1:print_summary=1:detect_leaks=0:detect_odr_violation=0";
66
}

0 commit comments

Comments
 (0)