Skip to content

Commit

Permalink
Fix last remaining C++ warnings (#8160)
Browse files Browse the repository at this point in the history
This fixes the last two remaining warnings I get when `pixi run
cpp-build-all`.

* One of them is just a switch I forgot in
#8057.
* The other is just GCC being weird... I dunno man.

---------

Co-authored-by: Andreas Reich <[email protected]>
  • Loading branch information
2 people authored and emilk committed Nov 20, 2024
1 parent 285d7bf commit 020ed29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rerun_cpp/src/rerun/recording_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <arrow/buffer.h>

#include <cassert>
#include <string> // to_string
#include <vector>

Expand All @@ -18,6 +19,9 @@ namespace rerun {

case StoreKind::Blueprint:
return RR_STORE_KIND_BLUEPRINT;

default:
assert(false && "unreachable");
}

// This should never happen since if we missed a switch case we'll get a warning on
Expand Down
3 changes: 3 additions & 0 deletions tests/cpp/plot_dashboard_stress/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,12 @@ int main(int argc, char** argv) {

std::vector<size_t> offsets;
if (temporal_batch_size.has_value()) {
// GCC wrongfully thinks that `temporal_batch_size` is uninitialized despite being initialized upon creation.
RR_DISABLE_MAYBE_UNINITIALIZED_PUSH
for (size_t i = 0; i < num_points_per_series; i += *temporal_batch_size) {
offsets.push_back(i);
}
RR_DISABLE_MAYBE_UNINITIALIZED_POP
} else {
offsets.resize(sim_times.size());
std::iota(offsets.begin(), offsets.end(), 0);
Expand Down

0 comments on commit 020ed29

Please sign in to comment.