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

Avoid various GCC 14 false positive issues #4046

Merged
merged 1 commit into from
May 13, 2024
Merged
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
6 changes: 4 additions & 2 deletions src/build-data/cc/gcc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ lang_flags "-std=c++20 -D_REENTRANT"
warning_flags "-Wall -Wextra -Wpedantic -Wstrict-aliasing -Wcast-align -Wmissing-declarations -Wpointer-arith -Wcast-qual -Wzero-as-null-pointer-constant -Wnon-virtual-dtor -Wold-style-cast -Wsuggest-override -Wshadow -Wextra-semi"

# Boost headers have 0 as nullptr and non-virtual-dtor issues so we can't werror on them
# Have to disable maybe-uninitialized due to GCC bugs like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937
werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor -Wno-error=maybe-uninitialized -Wno-error=stringop-overread"
# -Wmaybe-uninitialized is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105937
# -Wstringop-overread is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111499
# -Wfree-nonheap-object is buggy https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115016
werror_flags "-Werror -Wno-error=strict-overflow -Wno-error=zero-as-null-pointer-constant -Wno-error=non-virtual-dtor -Wno-error=maybe-uninitialized -Wno-error=stringop-overread -Wno-error=free-nonheap-object"

maintainer_warning_flags "-Wstrict-overflow=5"

Expand Down
4 changes: 4 additions & 0 deletions src/lib/pubkey/ec_group/ec_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,10 @@ EC_Group::EC_Group() = default;

EC_Group::~EC_Group() = default;

EC_Group::EC_Group(const EC_Group&) = default;

EC_Group& EC_Group::operator=(const EC_Group&) = default;

EC_Group::EC_Group(const OID& domain_oid) {
this->m_data = ec_group_data().lookup(domain_oid);
if(!this->m_data) {
Expand Down
4 changes: 2 additions & 2 deletions src/lib/pubkey/ec_group/ec_group.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ class BOTAN_PUBLIC_API(2, 0) EC_Group final {

~EC_Group();

EC_Group(const EC_Group&) = default;
EC_Group(const EC_Group&);
EC_Group(EC_Group&&) = default;

EC_Group& operator=(const EC_Group&) = default;
EC_Group& operator=(const EC_Group&);
EC_Group& operator=(EC_Group&&) = default;

/**
Expand Down
1 change: 1 addition & 0 deletions src/lib/tls/tls13/tls_cipher_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ std::vector<uint8_t> current_nonce(const uint64_t seq_no, const secure_vector<ui
// client_write_iv or server_write_iv (depending on the role).
std::vector<uint8_t> nonce(NONCE_LENGTH);
store_be(seq_no, nonce.data() + (NONCE_LENGTH - sizeof(seq_no)));
BOTAN_ASSERT_EQUAL(iv.size(), NONCE_LENGTH, "Invalid TLS 1.3 nonce length");
xor_buf(nonce, iv.data(), iv.size());
return nonce;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/tls/tls13/tls_extensions_key_share.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Key_Share_Entry {

std::vector<uint8_t> serialize() const {
std::vector<uint8_t> result;
result.reserve(m_key_exchange.size() + 2);
result.reserve(m_key_exchange.size() + 4);

const uint16_t named_curve_id = m_group.wire_code();
result.push_back(get_byte<0>(named_curve_id));
Expand Down
Loading