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

Fix compilation with newer compilers: GCC-14 and CLANG-16 #759

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/type/timestamp_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ auto TimestampType::ToString(const Value &val) const -> std::string {
tm /= 32;
auto month = static_cast<uint16_t>(tm);
const size_t date_str_len = 30;
const size_t zone_len = 5;
const size_t zone_len = 6;
char str[date_str_len];
char zone[zone_len];
snprintf(str, date_str_len, "%04d-%02d-%02d %02d:%02d:%02d.%06d", year, month, day, hour, min, sec, micro);
Expand All @@ -127,7 +127,7 @@ auto TimestampType::ToString(const Value &val) const -> std::string {
if (tz < 0) {
tz = -tz;
}
snprintf(zone, zone_len, "%02d", tz); // NOLINT
snprintf(zone, std::min(zone_len, sizeof(zone)), "%02d", tz); // NOLINT
str[27] = 0;
return std::string(std::string(str) + std::string(zone));
}
Expand Down
10 changes: 5 additions & 5 deletions third_party/backward-cpp/backward.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2443,8 +2443,8 @@ class TraceResolverLinuxImpl<trace_resolver_tag::libdwarf>
// If we have a valid elf handle, return the new elf handle
// and file handle and discard the original ones
if (debuglink_elf) {
elf_handle = move(debuglink_elf);
file_handle = move(debuglink_file);
elf_handle = std::move(debuglink_elf);
file_handle = std::move(debuglink_file);
}
}
}
Expand All @@ -2466,9 +2466,9 @@ class TraceResolverLinuxImpl<trace_resolver_tag::libdwarf>

dwarf_handle.reset(dwarf_debug);

r.file_handle = move(file_handle);
r.elf_handle = move(elf_handle);
r.dwarf_handle = move(dwarf_handle);
r.file_handle = std::move(file_handle);
r.elf_handle = std::move(elf_handle);
r.dwarf_handle = std::move(dwarf_handle);

return r;
}
Expand Down
2 changes: 1 addition & 1 deletion third_party/fmt/include/fmt/ranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class is_tuple_formattable_ {
template <typename T, typename C> class is_tuple_formattable_<T, C, true> {
template <std::size_t... Is>
static std::true_type check2(index_sequence<Is...>,
integer_sequence<bool, (Is == Is)...>);
integer_sequence<bool, (Is >= 0)...>);
static std::false_type check2(...);
template <std::size_t... Is>
static decltype(check2(
Expand Down