1
0
mirror of https://github.com/google/leveldb.git synced 2025-04-25 14:00:27 +08:00
This commit is contained in:
Benjamin Woosley 2025-02-26 14:57:28 +08:00 committed by GitHub
commit 79cff28221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

@ -262,6 +262,13 @@ if(BUILD_SHARED_LIBS)
)
endif(BUILD_SHARED_LIBS)
check_cxx_compiler_flag(-Werror=conditional-uninitialized HAVE_CONDITIONAL_UNINITIALIZED)
if(HAVE_CONDITIONAL_UNINITIALIZED)
target_compile_options(leveldb
PUBLIC
-Werror=conditional-uninitialized)
endif(HAVE_CONDITIONAL_UNINITIALIZED)
if(HAVE_CLANG_THREAD_SAFETY)
target_compile_options(leveldb
PUBLIC

View File

@ -158,7 +158,7 @@ class CorruptionTest : public testing::Test {
int Property(const std::string& name) {
std::string property;
int result;
int result = -1;
if (db_->GetProperty(name, &property) &&
sscanf(property.c_str(), "%d", &result) == 1) {
return result;

View File

@ -998,7 +998,7 @@ bool VersionSet::ReuseManifest(const std::string& dscname,
}
FileType manifest_type;
uint64_t manifest_number;
uint64_t manifest_size;
uint64_t manifest_size = 0;
if (!ParseFileName(dscbase, &manifest_number, &manifest_type) ||
manifest_type != kDescriptorFile ||
!env_->GetFileSize(dscname, &manifest_size).ok() ||