Skip to content

Commit fad402d

Browse files
committed
Fixes #234 ("dlmalloc_ext_2_8_6.c:warning: iteration 2305843009213693951 invokes undefined behavior")
1 parent a6a41e2 commit fad402d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

doc/container.qbk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,6 +1425,7 @@ use [*Boost.Container]? There are several reasons for that:
14251425

14261426
* Fixed bugs/issues:
14271427
* [@https://github.com/boostorg/container/issues/297 GitHub #297: ['"flat_map::try_emplace does not compile if allocator has construct"]].
1428+
* [@https://github.com/boostorg/container/issues/234 GitHub #234: ['"dlmalloc_ext_2_8_6.c:warning: iteration 2305843009213693951 invokes undefined behavior"]].
14281429

14291430
[endsect]
14301431

src/dlmalloc_ext_2_8_6.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
#define FORCEINLINE inline
3737
#endif
3838

39+
#define DLMALLOC_EXT_GCC_VERSION
40+
3941
#ifdef _MSC_VER
4042
#pragma warning (push)
4143
#pragma warning (disable : 4127)
@@ -47,6 +49,18 @@
4749
#pragma warning (disable : 4057) /*differs in indirection to slightly different base types from*/
4850
#pragma warning (disable : 4702) /*unreachable code*/
4951
#pragma warning (disable : 4127) /*conditional expression is constant*/
52+
#elif defined(__GNUC__)
53+
54+
# if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 48000)
55+
//Disable false positives triggered by -Waggressive-loop-optimizations
56+
# pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
57+
# endif
58+
59+
# if ((__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 46000)
60+
//Disable false positives triggered by -Warray-bounds
61+
# pragma GCC diagnostic ignored "-Warray-bounds"
62+
# endif
63+
5064
#endif
5165

5266
#include "dlmalloc_2_8_6.c"

0 commit comments

Comments
 (0)