Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlmalloc_ext_2_8_6.c:1085:41: warning: iteration 2305843009213693951 invokes undefined behavior [-Waggressive-loop-optimizations] #234

Open
mojca opened this issue Nov 12, 2022 · 0 comments

Comments

@mojca
Copy link

mojca commented Nov 12, 2022

I'm building a project with boost 1.80.0 as an external dependency, obtained via FetchContent as part of a CMake build.
I'm using gcc-12 on Ubuntu-22.04 and we are trying to get "treat warnings as errors" builds go through.

This is the warning I get:

[1/675] Building C object _deps/boost-build/libs/container/CMakeFiles/boost_container.dir/src/alloc_lib.c.o
In file included from ../__external/src/boost/libs/container/src/dlmalloc_ext_2_8_6.c:52,
                 from ../__external/src/boost/libs/container/src/alloc_lib.c:24:
In function ‘internal_multialloc_arrays’,
    inlined from ‘boost_cont_multialloc_arrays’ at ../__external/src/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1112:13:
../__external/src/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1085:41: warning: iteration 2305843009213693951 invokes undefined behavior [-Waggressive-loop-optimizations]
 1085 |                size = request2size(sizes[i]*element_size);
      |                                         ^
../__external/src/boost/libs/container/src/dlmalloc_2_8_6.c:2231:6: note: in definition of macro ‘request2size’
 2231 |   (((req) < MIN_REQUEST)? MIN_CHUNK_SIZE : pad_request(req))
      |      ^~~
../__external/src/boost/libs/container/src/dlmalloc_ext_2_8_6.c:1083:24: note: within this loop
 1083 |             for(++i; i != next_i; ++i) {
      |                      ~~^~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant