Skip to content

Commit

Permalink
Selectively disable -Wmaybe-uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrm456 authored Jan 4, 2024
1 parent 1431943 commit 8526fef
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 11 deletions.
19 changes: 8 additions & 11 deletions groups/ntc/ntcdns/ntcdns_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@
<< NTCI_LOG_STREAM_END; \
} while (false)


// Some versions of GCC erroneously warn when 'timeToLive.value()' is
// called even when protected by a check of '!timeToLive.isNull()'.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcdns {

Expand Down Expand Up @@ -372,13 +380,6 @@ void ClientGetIpAddressOperation::processResponse(
bsl::size_t serverIndex,
const bsls::TimeInterval& now)
{
// Some versions of GCC erroneously warn when 'timeToLive.value()' is
// called even when protected by a check of '!timeToLive.isNull()'.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

NTCI_LOG_CONTEXT();

ntsa::Error error;
Expand Down Expand Up @@ -545,10 +546,6 @@ void ClientGetIpAddressOperation::processResponse(

d_resolver_sp.reset();
d_serverList.clear();

#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic pop
#endif
}

void ClientGetIpAddressOperation::processError(const ntsa::Error& error)
Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcp/ntcp_datagramsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ BSLS_IDENT_RCSID(ntcp_datagramsocket_cpp, "$Id$ $CSID$")
NTCI_LOG_TRACE("Datagram socket " \
"is shutting down transmission")

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcp {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcp/ntcp_listenersocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,13 @@ BSLS_IDENT_RCSID(ntcp_listenersocket_cpp, "$Id$ $CSID$")
NTCI_LOG_TRACE("Listener socket " \
"is shutting down acceptance")

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcp {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcp/ntcp_streamsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ BSLS_IDENT_RCSID(ntcp_streamsocket_cpp, "$Id$ $CSID$")
NTCI_LOG_TRACE("Stream socket " \
"is shutting down transmission")

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcp {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcr/ntcr_datagramsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,13 @@ BSLS_IDENT_RCSID(ntcr_datagramsocket_cpp, "$Id$ $CSID$")
#define NTCR_DATAGRAMSOCKET_LOG_RX_DELAY(delay, type)
#endif

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcr {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcr/ntcr_listenersocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ BSLS_IDENT_RCSID(ntcr_listenersocket_cpp, "$Id$ $CSID$")
NTCI_LOG_TRACE("Listener socket " \
"is shutting down acceptance")

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcr {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcr/ntcr_streamsocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,13 @@ BSLS_IDENT_RCSID(ntcr_streamsocket_cpp, "$Id$ $CSID$")
#define NTCR_STREAMSOCKET_LOG_RX_DELAY(delay, type)
#endif

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

namespace BloombergLP {
namespace ntcr {

Expand Down
7 changes: 7 additions & 0 deletions groups/ntc/ntcs/ntcs_strand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ BSLS_IDENT_RCSID(ntcs_strand_cpp, "$Id$ $CSID$")
// Define the strand implementation algorithm.
#define NTCS_STRAND_IMP NTCS_STRAND_IMP_GREEDY

// Some versions of GCC erroneously warn ntcs::ObserverRef::d_shared may be
// uninitialized.
#if defined(BSLS_PLATFORM_CMP_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif

// IMPLEMENTATION NOTES: Testing indicates that, with 10 threads driving the
// reactor utilized by a strand, fair algorithm achieves 250,000 functors per
// second, evenly distributed across all threads, while the greedy algorithm
Expand Down

0 comments on commit 8526fef

Please sign in to comment.