Skip to content

Commit

Permalink
dbformat.h: IterKey: suppress compiler false warn
Browse files Browse the repository at this point in the history
  • Loading branch information
rockeet committed Jan 28, 2023
1 parent 10580b9 commit 949bb8b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion db/dbformat.h
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,15 @@ class IterKey {
buf_ = p;
buf_size_ = total_size;
}

#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
memcpy(buf() + shared_len, non_shared_data, non_shared_len);
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
key_ = buf();
key_size_ = total_size;
}
Expand Down Expand Up @@ -644,7 +651,14 @@ class IterKey {

void ResetBuffer() {
if (sizeof(space_) != buf_size_) {
#if defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
delete[] buf_;
#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
}
buf_size_ = sizeof(space_);
key_size_ = 0;
Expand Down

0 comments on commit 949bb8b

Please sign in to comment.