Fix warnings from GCC 13 release build (#5637)

This commit is contained in:
Tyler Veness
2023-09-15 10:37:52 -07:00
committed by GitHub
parent e7e927fe26
commit 4f2114d6f5
4 changed files with 12 additions and 3 deletions

View File

@@ -17,6 +17,11 @@
namespace nt::net {
#if __GNUC__ >= 13
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
struct PublishMsg {
static constexpr std::string_view kMethodStr = "publish";
NT_Publisher pubHandle{0};
@@ -57,6 +62,10 @@ struct ClientValueMsg {
Value value;
};
#if __GNUC__ >= 13
#pragma GCC diagnostic pop
#endif
struct ClientMessage {
using Contents =
std::variant<std::monostate, PublishMsg, UnpublishMsg, SetPropertiesMsg,

View File

@@ -629,7 +629,7 @@ class Value final {
friend bool operator==(const Value& lhs, const Value& rhs);
private:
NT_Value m_val;
NT_Value m_val = {};
std::shared_ptr<void> m_storage;
};

View File

@@ -54,7 +54,7 @@ TEST_P(AllianceTest, Alliance) {
frc::sim::StepTiming(20_ms);
bool isRed;
bool isRed = false;
switch (alliance) {
case HAL_AllianceStationID_kBlue1:
case HAL_AllianceStationID_kBlue2:

View File

@@ -61,7 +61,7 @@ TEST_P(AllianceTest, Alliance) {
frc::sim::StepTiming(20_ms);
char expected;
char expected = 'U';
switch (alliance) {
case HAL_AllianceStationID_kBlue1:
case HAL_AllianceStationID_kBlue2: