Skip to content

Commit 57fea81

Browse files
committed
Work around gcc warning
This shuts up a 300-line warning that includes /nix/store/fg7ass3a5m5pgl26qzfdniicbwbgzccy-gcc-13.2.0/include/c++/13.2.0/bits/stl_tree.h:182:25: warning: ‘*(std::_Rb_tree_header*)((char*)&<unnamed> + offsetof(nix::value_type, nix::DerivedPath::<unnamed>.std::variant<nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Variant_base<nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Move_assign_base<false, nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Copy_assign_base<false, nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Move_ctor_base<false, nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Copy_ctor_base<false, nix::DerivedPathOpaque, nix::DerivedPathBuilt>::<unnamed>.std::__detail::__variant::_Variant_storage<false, nix::DerivedPathOpaque, nix::DerivedPathBuilt>::_M_u) + 24).std::_Rb_tree_header::_M_header.std::_Rb_tree_node_base::_M_parent’ may be used uninitialized [-Wmaybe-uninitialized] 182 | if (__x._M_header._M_parent != nullptr) | ~~~~~~~~~~~~~~^~~~~~~~~
1 parent 7e68306 commit 57fea81

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/nix/flake.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,10 +643,11 @@ struct CmdFlakeCheck : FlakeCommand
643643
fmt("%s.%s.%s", name, attr_name, state->symbols[attr2.name]),
644644
*attr2.value, attr2.pos);
645645
if (drvPath && attr_name == settings.thisSystem.get()) {
646-
drvPaths.push_back(DerivedPath::Built {
646+
auto path = DerivedPath::Built {
647647
.drvPath = makeConstantStorePathRef(*drvPath),
648648
.outputs = OutputsSpec::All { },
649-
});
649+
};
650+
drvPaths.push_back(std::move(path));
650651
}
651652
}
652653
}

0 commit comments

Comments
 (0)