Skip to content

Commit

Permalink
RCORE-2188 fix gcc warnings and add a ubuntu 2404 GCC runner (#7856)
Browse files Browse the repository at this point in the history
* fix gcc warnings and add a ubuntu 2404 GCC runner
* fix a compiler error in newer gcc 'error: possibly dangling reference to a temporary'
* fix build error on alpin due to missing header
---------

Co-authored-by: Kirill Burtsev <[email protected]>
  • Loading branch information
ironage and kiburtse authored Jul 1, 2024
1 parent 3551a42 commit 83ba52f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 42 deletions.
11 changes: 10 additions & 1 deletion evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,15 @@ buildvariants:
tasks:
- name: compile_local_tests

- name: ubuntu-2404-GCC
display_name: "Ubuntu 24.04 arm64 (native GCC)"
run_on: ubuntu2404-arm64-large
expansions:
fetch_missing_dependencies: On
disable_tests_against_baas: On
tasks:
- name: compile_local_tests

- name: ubuntu-encryption-tsan
display_name: "Ubuntu (Encryption Enabled w/TSAN)"
run_on: ubuntu2204-arm64-small
Expand Down Expand Up @@ -1488,7 +1497,7 @@ buildvariants:
- name: generate-sync-corpus

- name: ubuntu2004-arm64
display_name: "Ubuntu 20.04 ARM64 (Clang 11 release benchmarks)"
display_name: "Ubuntu 20.04 ARM64 (GCC 9 release benchmarks)"
run_on: ubuntu2004-arm64-large
expansions:
cmake_url: "https://s3.amazonaws.com/static.realm.io/evergreen-assets/cmake-3.26.3-linux-aarch64.tar.gz"
Expand Down
5 changes: 2 additions & 3 deletions src/external/s2/s2polygonbuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,8 @@ S2Loop* S2PolygonBuilder::AssembleLoop(S2Point const& v0, S2Point const& v1,
path.push_back(v1);
index[v1] = 1;
while (path.size() >= 2) {
// Note that "v0" and "v1" become invalid if "path" is modified.
S2Point const& v0 = path.end()[-2];
S2Point const& v1 = path.end()[-1];
S2Point const v0 = path.end()[-2];
S2Point const v1 = path.end()[-1];
S2Point v2;
bool v2_found = false;
EdgeSet::const_iterator candidates = edges_->find(v1);
Expand Down
36 changes: 0 additions & 36 deletions src/realm/sync/noinst/client_reset_recovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,11 @@ struct ListPath {
ColumnKey,
} type;

bool operator==(const Element& other) const noexcept;
bool operator!=(const Element& other) const noexcept;
bool operator<(const Element& other) const noexcept;
};

void append(const Element& item);
bool operator<(const ListPath& other) const noexcept;
bool operator==(const ListPath& other) const noexcept;
std::string path_to_string(Transaction& remote, const InterningBuffer& buffer);

using const_iterator = typename std::vector<Element>::const_iterator;
Expand Down Expand Up @@ -419,26 +416,6 @@ ListPath::Element::Element(ColKey key)
{
}

bool ListPath::Element::operator==(const Element& other) const noexcept
{
if (type == other.type) {
switch (type) {
case Type::InternKey:
return intern_key == other.intern_key;
case Type::ListIndex:
return index == other.index;
case Type::ColumnKey:
return col_key == other.col_key;
}
}
return false;
}

bool ListPath::Element::operator!=(const Element& other) const noexcept
{
return !(operator==(other));
}

bool ListPath::Element::operator<(const Element& other) const noexcept
{
if (type < other.type) {
Expand Down Expand Up @@ -476,19 +453,6 @@ bool ListPath::operator<(const ListPath& other) const noexcept
return std::lexicographical_compare(m_path.begin(), m_path.end(), other.m_path.begin(), other.m_path.end());
}

bool ListPath::operator==(const ListPath& other) const noexcept
{
if (m_table_key == other.m_table_key && m_obj_key == other.m_obj_key && m_path.size() == other.m_path.size()) {
for (size_t i = 0; i < m_path.size(); ++i) {
if (m_path[i] != other.m_path[i]) {
return false;
}
}
return true;
}
return false;
}

std::string ListPath::path_to_string(Transaction& remote, const InterningBuffer& buffer)
{
TableRef remote_table = remote.get_table(m_table_key);
Expand Down
6 changes: 4 additions & 2 deletions src/realm/util/cli_args.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#include "realm/util/cli_args.hpp"
#include <string>
#include <errno.h>

#include <algorithm>
#include <cerrno>
#include <cstdint>
#include <string>

namespace realm::util {

Expand Down

0 comments on commit 83ba52f

Please sign in to comment.