Skip to content
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: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ if ((ARCHITECTURE MATCHES "arm64") AND (CMAKE_SYSTEM_NAME STREQUAL "Darwin") AND
endif()
#END M1 support

if (CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "20")
add_compile_options(--warning-suppression-mappings=${CMAKE_CURRENT_SOURCE_DIR}/suppression_mappings.txt)
endif()

option(TON_WERROR_BUILD "Use -Werror" OFF)

# If we want to check -Werror build in CI, we want to use it for third party projects as well but we
Expand Down
2 changes: 0 additions & 2 deletions catchain/catchain-receiver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ static const double EXPECTED_INITIAL_SYNC_DURATION = 5.0;
static const td::uint32 OVERLAY_MAX_ALLOWED_PACKET_SIZE = 16 * 1024 * 1024;
static const double NEIGHBOURS_ROTATE_INTERVAL_MIN = 60;
static const double NEIGHBOURS_ROTATE_INTERVAL_MAX = 120;
static const td::uint32 MAX_QUERY_BLOCKS = 100;
static const td::uint32 MAX_QUERY_HEIGHT = 100;
static const td::uint32 GET_DIFFERENCE_MAX_SEND = 100;
static const double GET_DIFFERENCE_TIMEOUT = 5.0;
static const double GET_BLOCK_TIMEOUT = 2.0;
Expand Down
1 change: 0 additions & 1 deletion crypto/block/block-parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,6 @@ bool TrComputeInternal1::validate_skip(int* ops, vm::CellSlice& cs, bool weak) c
// vm_final_state_hash:uint256
}

const TrComputeInternal1 t_TrComputeInternal1;
const RefTo<TrComputeInternal1> t_Ref_TrComputeInternal1;
const ComputeSkipReason t_ComputeSkipReason;

Expand Down
2 changes: 1 addition & 1 deletion crypto/block/precompiled-smc/PrecompiledSmartContract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ std::unique_ptr<PrecompiledSmartContract> get_implementation(td::Bits256 code_ha
return nullptr;
}
static std::map<td::Bits256, std::unique_ptr<PrecompiledSmartContract> (*)()> map = []() {
auto from_hex = [](td::Slice s) -> td::Bits256 {
[[maybe_unused]] auto from_hex = [](td::Slice s) -> td::Bits256 {
td::Bits256 x;
CHECK(x.from_hex(s) == 256);
return x;
Expand Down
2 changes: 1 addition & 1 deletion crypto/block/transaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,7 @@ bool Transaction::prepare_compute_phase(const ComputePhaseConfig& cfg) {
return true;
}
if (cfg.disable_anycast && acc_status == Account::acc_uninit &&
new_fixed_prefix_length > cfg.size_limits.max_acc_fixed_prefix_length) {
new_fixed_prefix_length > static_cast<int>(cfg.size_limits.max_acc_fixed_prefix_length)) {
LOG(DEBUG) << "cannot init account state: too big fixed prefix length (" << new_fixed_prefix_length << ", max "
<< cfg.size_limits.max_acc_fixed_prefix_length << ")";
cp.skip_reason = ComputePhase::sk_bad_state;
Expand Down
4 changes: 2 additions & 2 deletions crypto/parser/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ const Lexem& Lexer::next() {
return lexem.clear(src.here(), Lexem::Eof);
}
if (is_multiline_quote(src.get_ptr(), src.get_end_ptr())) {
src.advance(multiline_quote.size());
src.advance(static_cast<int>(multiline_quote.size()));
const char* end = nullptr;
SrcLocation here = src.here();
std::string body;
Expand All @@ -265,7 +265,7 @@ const Lexem& Lexer::next() {
}
if (is_multiline_quote(src.get_ptr(), src.get_end_ptr())) {
end = src.get_ptr();
src.advance(multiline_quote.size());
src.advance(static_cast<int>(multiline_quote.size()));
break;
}
body.push_back(src.cur_char());
Expand Down
3 changes: 0 additions & 3 deletions crypto/smartcont/asm-to-cpp.fif
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ $1 =: source
$2 =: destination
$3 =: name

."Include source from " source type cr
source include

boc>B
."Convert boc to base64" cr
B>base64

{ char " chr tuck $+ $+ } : wrp
Expand All @@ -27,5 +25,4 @@ wrp // "<code>"

$>B

."Store tvm code to " destination type cr
destination B>file
13 changes: 8 additions & 5 deletions crypto/test/test-db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,18 @@
#include <numeric>
#include <openssl/sha.h>
#include <optional>
#include <rocksdb/compaction_filter.h>
#include <rocksdb/db.h>
#include <rocksdb/merge_operator.h>
#include <set>
#include <thread>
#include <variant>

// FIXME: Remove once RocksDB stops triggering this warning.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
#include "rocksdb/compaction_filter.h"
#include "rocksdb/db.h"
#include "rocksdb/merge_operator.h"
#pragma GCC diagnostic pop

#include "common/AtomicRef.h"
#include "openssl/digest.hpp"
#include "storage/db.h"
Expand Down Expand Up @@ -2116,12 +2121,10 @@ TEST(TonDb, DynamicBocIncSimple) {
return;
}
//LOG(ERROR) << "POP ROOT";
auto begin_stats = kv->get_usage_stats();
auto cell = db->load_cell(queue.pop().as_slice()).move_as_ok();
db->dec(cell);
vm::CellStorer cell_storer(*kv);
db->commit(cell_storer);
auto end_stats = kv->get_usage_stats();
db->set_loader(std::make_unique<vm::CellLoader>(kv));
//LOG(ERROR) << end_stats - begin_stats;
//LOG(ERROR) << "CELLS IN DB: " << kv->count("").move_as_ok();
Expand Down
1 change: 0 additions & 1 deletion crypto/test/test-smartcont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,6 @@ void do_dns_test(CheckedDns&& dns) {
actions.clear();
}
auto name = gen_name();
auto category = td::Bits256::zero();
dns.resolve(name, intToCat(rnd.fast(0, 5)));
}
};
Expand Down
9 changes: 4 additions & 5 deletions crypto/tl/tlbc-gen-cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ bool CppTypeCode::generate_get_tag_pfx_distinguisher(std::ostream& os, std::stri
}
int d = trie->compute_useful_depth();
bool is_pfx_determ = !trie->find_conflict_path();
assert(is_pfx_determ);
CHECK(is_pfx_determ);
if (!in_block) {
os << " {";
}
Expand Down Expand Up @@ -2173,7 +2173,7 @@ bool CppTypeCode::output_print_simple_field(std::ostream& os, const Field& field
switch (cvt) {
case ct_bitstring:
case ct_bits:
assert(!(sz.max_size() & 0xff));
CHECK(!(sz.max_size() & 0xff));
os << "pp.fetch_bits_field(cs, ";
output_cpp_sizeof_expr(os, expr, 0);
if (!field_name.empty()) {
Expand All @@ -2186,7 +2186,7 @@ bool CppTypeCode::output_print_simple_field(std::ostream& os, const Field& field
case ct_uint32:
case ct_int64:
case ct_uint64:
assert(i && l <= 64);
CHECK(i && l <= 64);
os << "pp.fetch_" << (i > 0 ? "u" : "") << "int_field(cs, ";
output_cpp_sizeof_expr(os, expr, 0);
if (!field_name.empty()) {
Expand All @@ -2195,7 +2195,7 @@ bool CppTypeCode::output_print_simple_field(std::ostream& os, const Field& field
os << ")";
return true;
case ct_integer:
assert(i);
CHECK(i);
os << "pp.fetch_" << (i > 0 ? "u" : "") << "int256_field(cs, ";
output_cpp_sizeof_expr(os, expr, 0);
if (!field_name.empty()) {
Expand Down Expand Up @@ -2871,7 +2871,6 @@ void CppTypeCode::ConsRecord::declare_record(std::ostream& os, std::string nl, i
os << nl << " typedef " << cpp_type.cpp_type_class_name << " type_class;\n";
CppIdentSet rec_cpp_ids;
recover_idents(rec_cpp_ids);
std::size_t n = cpp_fields.size();
for (const ConsField& fi : cpp_fields) {
os << nl << " ";
fi.print_type(os);
Expand Down
2 changes: 1 addition & 1 deletion crypto/vm/boc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ bool VmStorageStat::add_storage(const CellSlice& cs) {
}

void ProofStorageStat::add_loaded_cell(const Ref<DataCell>& cell, td::uint8 max_level) {
max_level = std::min<td::uint32>(max_level, Cell::max_level);
max_level = std::min<td::uint8>(max_level, Cell::max_level);
auto& [status, size] = cells_[cell->get_hash(max_level)];
if (status == c_loaded) {
return;
Expand Down
10 changes: 6 additions & 4 deletions crypto/vm/dict.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1811,9 +1811,10 @@ static Ref<Cell> dict_build(td::Span<std::pair<td::ConstBitPtr, Ref<CellBuilder>
}
return cb.finalize();
}
size_t common_prefix_len;
size_t common_prefix_len_s;
td::bitstring::bits_memcmp(values.front().first + prefix_len, values.back().first + prefix_len,
total_key_len - prefix_len, &common_prefix_len);
total_key_len - prefix_len, &common_prefix_len_s);
int common_prefix_len = static_cast<int>(common_prefix_len_s);
CHECK(prefix_len + common_prefix_len < total_key_len);
size_t idx = 0;
while (values[idx].first[prefix_len + common_prefix_len] == 0) {
Expand Down Expand Up @@ -1843,9 +1844,10 @@ Ref<Cell> Dictionary::dict_multiset(Ref<Cell> dict1, td::Span<std::pair<td::Cons
assert(!skip1);
return dict1;
}
size_t common_prefix_len;
size_t common_prefix_len_s;
td::bitstring::bits_memcmp(values2.front().first + prefix_len, values2.back().first + prefix_len,
total_key_len - prefix_len, &common_prefix_len);
total_key_len - prefix_len, &common_prefix_len_s);
int common_prefix_len = static_cast<int>(common_prefix_len_s);
assert(prefix_len + common_prefix_len < total_key_len || values2.size() == 1);
// both dictionaries non-empty
// skip1: remove that much first bits from all keys in dictionary dict1 (its keys are actually n + skip1 bits long)
Expand Down
2 changes: 1 addition & 1 deletion crypto/vm/large-boc-serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ td::Result<int> LargeBocSerializer::import_cell(Hash root_hash, int root_depth)
refs[j] = next_depth_it->second.first;
continue;
}
auto res = next_depth_hashes.emplace(child_hash, std::make_pair(next_child_idx, false));
next_depth_hashes.emplace(child_hash, std::make_pair(next_child_idx, false));
refs[j] = next_child_idx++;
}

Expand Down
4 changes: 2 additions & 2 deletions lite-client/lite-client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ void TestNode::got_server_mc_block_id(ton::BlockIdExt blkid, ton::ZeroStateIdExt
td::TerminalIO::out() << "latest masterchain block known to server is " << blkid.to_str();
if (created > 0) {
auto time = now();
if (time >= created) {
if (time >= static_cast<ton::UnixTime>(created)) {
td::TerminalIO::out() << " created at " << created << " (" << time - created << " seconds ago)\n";
} else {
td::TerminalIO::out() << " created at " << created << " (" << created - time << " seconds in the future)\n";
Expand Down Expand Up @@ -3917,7 +3917,7 @@ void TestNode::continue_check_validator_load4(std::unique_ptr<TestNode::Validato
return;
}
mtc_shard_share.resize(count);
for (size_t i = 0; i < count; ++i) {
for (int i = 0; i < count; ++i) {
mtc_shard_share[i] = mtc[i];
}
}
Expand Down
40 changes: 0 additions & 40 deletions suppression_mappings.txt

This file was deleted.

2 changes: 0 additions & 2 deletions tdactor/td/actor/ActorStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ std::string ActorStats::prepare_stats() {
}
sb << "\n";
sb << "================================= ACTORS STATS =================================\n";
double max_delay = 0;
ActorTypeStat sum_stat_forever;
ActorTypeStat sum_stat_10m;
ActorTypeStat sum_stat_10s;
Expand Down Expand Up @@ -214,7 +213,6 @@ std::string ActorStats::prepare_stats() {
sb << "All actors:\n";
for (auto &it : stats) {
sb << "\t" << ActorTypeStatManager::get_class_name(it.first.name()) << "\n";
auto key = main_key(it.first);
describe(sb, it.first);
}
sb << "\n";
Expand Down
6 changes: 6 additions & 0 deletions tddb/td/db/RocksDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@
Copyright 2017-2020 Telegram Systems LLP
*/

// FIXME: Remove once RocksDB stops triggering this warning.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wimplicit-int-float-conversion"
#include "rocksdb/db.h"
#pragma GCC diagnostic pop

#include "rocksdb/filter_policy.h"
#include "rocksdb/statistics.h"
#include "rocksdb/table.h"
Expand Down
14 changes: 14 additions & 0 deletions tl/generate/tl_writer_hpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@
*/
#include <cassert>

#include "td/utils/port/platform.h"

#include "tl_writer_hpp.h"

namespace td {

#if TD_MSVC
[[noreturn]] void unreachable() {
__assume(0);
}
#else
[[noreturn]] void unreachable() {
__builtin_unreachable();
}
#endif

bool TD_TL_writer_hpp::is_documentation_generated() const {
return true;
}
Expand Down Expand Up @@ -231,6 +243,7 @@ std::string TD_TL_writer_hpp::gen_additional_proxy_function_begin(const std::str
"switch (obj.get_id()) {";
}
assert(false);
unreachable();
}

std::string TD_TL_writer_hpp::gen_additional_proxy_function_case(const std::string &function_name,
Expand Down Expand Up @@ -261,6 +274,7 @@ std::string TD_TL_writer_hpp::gen_additional_proxy_function_case(const std::stri
" return true;\n";
}
assert(false);
unreachable();
}

std::string TD_TL_writer_hpp::gen_additional_proxy_function_end(const std::string &function_name,
Expand Down
8 changes: 4 additions & 4 deletions tonlib/tonlib/TonlibClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1911,7 +1911,7 @@ class GetOutMsgQueueSizes : public td::actor::Actor {
return td::Status::Error("no out_msg_queue_size in shard state");
}
td::uint64 size = size_slice.prefetch_ulong(48);
if (size != f->size_) {
if (static_cast<std::int64_t>(size) != f->size_) {
return td::Status::Error("queue size mismatch");
}
return td::Status::OK();
Expand Down Expand Up @@ -1941,8 +1941,8 @@ class GetOutMsgQueueSizes : public td::actor::Actor {
if (--pending_ == 0) {
std::vector<tonlib_api::object_ptr<tonlib_api::blocks_outMsgQueueSize>> shards;
for (size_t i = 0; i < blocks_.size(); ++i) {
shards.push_back(
tonlib_api::make_object<tonlib_api::blocks_outMsgQueueSize>(to_tonlib_api(blocks_[i]), sizes_[i]));
shards.push_back(tonlib_api::make_object<tonlib_api::blocks_outMsgQueueSize>(
to_tonlib_api(blocks_[i]), static_cast<td::uint32>(sizes_[i])));
}
promise_.set_result(
tonlib_api::make_object<tonlib_api::blocks_outMsgQueueSizes>(std::move(shards), ext_msg_queue_size_limit_));
Expand Down Expand Up @@ -6110,7 +6110,7 @@ td::Status check_lookup_block_proof(lite_api_ptr<ton::lite_api::liteServer_looku
for (size_t i = 0; i < prev.size(); i++) {
if (prev[i].root_hash == prev_root->get_hash().bits()) {
prev_valid = true;
prev_idx = i;
prev_idx = static_cast<int>(i);
}
}
if (!prev_valid) {
Expand Down
2 changes: 1 addition & 1 deletion validator-session/candidate-serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ td::Result<tl_object_ptr<ton_api::validatorSession_candidate>> deserialize_candi
},
[&](ton_api::validatorSession_compressedCandidateV2& c) {
res = [&]() -> td::Result<tl_object_ptr<ton_api::validatorSession_candidate>> {
if (c.data_.size() > max_decompressed_data_size) {
if (static_cast<int>(c.data_.size()) > max_decompressed_data_size) {
return td::Status::Error("Compressed data is too big");
}
TRY_RESULT(p, decompress_candidate_data(c.data_, true, 0, max_decompressed_data_size,
Expand Down
Loading
Loading