facebookexperimental / facebookexperimental/libunifex

/builddir/build/BUILD/libunifex-0.4.0/include/unifex/v2/async_scope.hpp:76:52: error: ‘MEM[(const struct scope_reference *)&optFuture].scope_’ may be used uninitialized [-Werror=maybe-uninitialized]

Open
#600 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
210
PR merge metrics
No merged PRs in 30d

Description

```bash
[152/207] /usr/bin/g++ -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -I/builddir/build/BUILD/libunifex-0.4.0/include -I/builddir/build/BUILD/libunifex-0.4.0/redhat-linux-build/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG -std=gnu++20 -Wall -Wextra -pedantic -Werror -MD -MT test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o -MF test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o.d -o test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o -c /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp
FAILED: test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o
/usr/bin/g++ -DGTEST_LINKED_AS_SHARED_LIBRARY=1 -I/builddir/build/BUILD/libunifex-0.4.0/include -I/builddir/build/BUILD/libunifex-0.4.0/redhat-linux-build/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -DNDEBUG -std=gnu++20 -Wall -Wextra -pedantic -Werror -MD -MT test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o -MF test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o.d -o test/CMakeFiles/async_scope_test.dir/async_scope_test.cpp.o -c /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp
In file included from /builddir/build/BUILD/libunifex-0.4.0/include/unifex/v1/async_scope.hpp:37,
from /builddir/build/BUILD/libunifex-0.4.0/include/unifex/async_scope.hpp:18,
from /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:33:
In member function ‘unifex::v2::_async_scope::scope_reference::operator bool() const’,
inlined from ‘unifex::v2::_async_scope::_nest_sender::type>::type>::type>::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/v2/async_scope.hpp:365:9,
inlined from ‘unifex::_spawn_future::_future::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/spawn_future.hpp:835:3,
inlined from ‘std::_Optional_payload_base::type>::_M_destroy()’ at /usr/include/c++/14/optional:283:35,
inlined from ‘std::_Optional_payload_base::type>::_M_reset()’ at /usr/include/c++/14/optional:314:14,
inlined from ‘std::_Optional_payload::type, false, false, false>::~_Optional_payload()’ at /usr/include/c++/14/optional:437:65,
inlined from ‘std::_Optional_base::type, false, false>::~_Optional_base()’ at /usr/include/c++/14/optional:508:12,
inlined from ‘std::optional::type>::~optional()’ at /usr/include/c++/14/optional:703:11,
inlined from ‘async_scope_test_discarding_a_future_requests_cancellation_Test::TestBody()’ at /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:230:1:
/builddir/build/BUILD/libunifex-0.4.0/include/unifex/v2/async_scope.hpp:76:52: error: ‘MEM[(const struct scope_reference *)&optFuture].scope_’ may be used uninitialized [-Werror=maybe-uninitialized]
76 | explicit operator bool() const noexcept { return scope_ != nullptr; }
| ^~~~~~
/builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp: In member function ‘async_scope_test_discarding_a_future_requests_cancellation_Test::TestBody()’:
/builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:197:27: note: ‘optFuture’ declared here
197 | std::optional> optFuture = scope.spawn_on(
| ^~~~~~~~~
In file included from /usr/include/c++/14/memory:78,
from /builddir/build/BUILD/libunifex-0.4.0/include/unifex/get_allocator.hpp:21,
from /builddir/build/BUILD/libunifex-0.4.0/include/unifex/allocate.hpp:19,
from /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:17:
In member function ‘std::unique_ptr::type, unifex::_spawn_future::_op_dropper>::~unique_ptr()’,
inlined from ‘unifex::_spawn_future::_future_sender_from_stop_token<>::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/spawn_future.hpp:706:46,
inlined from ‘unifex::_let_v_w_stop_tok::_stop_token_sender::type>::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/let_value_with_stop_token.hpp:125:45,
inlined from ‘unifex::v1::_async_scope::_attach_sender::type>::type>::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/v1/async_scope.hpp:229:32,
inlined from ‘unifex::manual_lifetime::type>::type>::type>::destruct()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/manual_lifetime.hpp:54:14,
inlined from ‘unifex::v2::_async_scope::_nest_sender::type>::type>::type>::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/v2/async_scope.hpp:366:23,
inlined from ‘unifex::_spawn_future::_future::type::~type()’ at /builddir/build/BUILD/libunifex-0.4.0/include/unifex/spawn_future.hpp:835:3,
inlined from ‘std::_Optional_payload_base::type>::_M_destroy()’ at /usr/include/c++/14/optional:283:35,
inlined from ‘std::_Optional_payload_base::type>::_M_reset()’ at /usr/include/c++/14/optional:314:14,
inlined from ‘std::_Optional_payload::type, false, false, false>::~_Optional_payload()’ at /usr/include/c++/14/optional:437:65,
inlined from ‘std::_Optional_base::type, false, false>::~_Optional_base()’ at /usr/include/c++/14/optional:508:12,
inlined from ‘std::optional::type>::~optional()’ at /usr/include/c++/14/optional:703:11,
inlined from ‘async_scope_test_discarding_a_future_requests_cancellation_Test::TestBody()’ at /builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:230:1:
/usr/include/c++/14/bits/unique_ptr.h:397:19: error: ‘MEM[(struct type * &)&optFuture + 24]’ may be used uninitialized [-Werror=maybe-uninitialized]
397 | if (__ptr != nullptr)
| ~~~~~~^~~~~~~~~~
/builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp: In member function ‘async_scope_test_discarding_a_future_requests_cancellation_Test::TestBody()’:
/builddir/build/BUILD/libunifex-0.4.0/test/async_scope_test.cpp:197:27: note: ‘optFuture’ declared here
197 | std::optional> optFuture = scope.spawn_on(
| ^~~~~~~~~
cc1plus: all warnings being treated as errors
```

build log: https://kojipkgs.fedoraproject.org//work/tasks/8962/112318962/build.log

OS: Fedora 40
Compiler: gcc 14

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.