Fixes #234 ("dlmalloc_ext_2_8_6.c⚠️ iteration 2305843009213693951 invokes undefined behavior")

This commit is contained in:
Ion Gaztañaga
2024-12-23 19:35:53 +01:00
parent a6a41e2356
commit fad402d037
2 changed files with 15 additions and 0 deletions

View File

@ -1425,6 +1425,7 @@ use [*Boost.Container]? There are several reasons for that:
* Fixed bugs/issues:
* [@https://github.com/boostorg/container/issues/297 GitHub #297: ['"flat_map::try_emplace does not compile if allocator has construct"]].
* [@https://github.com/boostorg/container/issues/234 GitHub #234: ['"dlmalloc_ext_2_8_6.c:warning: iteration 2305843009213693951 invokes undefined behavior"]].
[endsect]

View File

@ -36,6 +36,8 @@
#define FORCEINLINE inline
#endif
#define DLMALLOC_EXT_GCC_VERSION
#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4127)
@ -47,6 +49,18 @@
#pragma warning (disable : 4057) /*differs in indirection to slightly different base types from*/
#pragma warning (disable : 4702) /*unreachable code*/
#pragma warning (disable : 4127) /*conditional expression is constant*/
#elif defined(__GNUC__)
# if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 48000)
//Disable false positives triggered by -Waggressive-loop-optimizations
# pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
# endif
# if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 46000)
//Disable false positives triggered by -Warray-bounds
# pragma GCC diagnostic ignored "-Warray-bounds"
# endif
#endif
#include "dlmalloc_2_8_6.c"