Skip to content

Commit

Permalink
Fixes #234 ("dlmalloc_ext_2_8_6.c:warning: iteration 2305843009213693…
Browse files Browse the repository at this point in the history
…951 invokes undefined behavior")
  • Loading branch information
igaztanaga committed Dec 23, 2024
1 parent a6a41e2 commit fad402d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/container.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
14 changes: 14 additions & 0 deletions src/dlmalloc_ext_2_8_6.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#define FORCEINLINE inline
#endif

#define DLMALLOC_EXT_GCC_VERSION

This comment has been minimized.

Copy link
@valiko-ua

valiko-ua Dec 24, 2024

This seems not used, at least in this commit.


#ifdef _MSC_VER
#pragma warning (push)
#pragma warning (disable : 4127)
Expand All @@ -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"
Expand Down

0 comments on commit fad402d

Please sign in to comment.