mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
Add missing compiler flags and fix warnings (#4889)
This makes the build fail on warnings. It caught two out-of-bounds reads and a deprecation warning.
This commit is contained in:
@@ -10,6 +10,7 @@ foreach(example ${EXAMPLES})
|
||||
file(GLOB_RECURSE sources src/main/cpp/examples/${example}/cpp/*.cpp
|
||||
src/main/cpp/examples/${example}/c/*.c)
|
||||
add_executable(${example} ${sources})
|
||||
wpilib_target_warnings(${example})
|
||||
target_include_directories(${example} PUBLIC src/main/cpp/examples/${example}/include)
|
||||
target_link_libraries(${example} wpilibc wpilibNewCommands)
|
||||
|
||||
@@ -28,6 +29,7 @@ foreach(template ${TEMPLATES})
|
||||
file(GLOB_RECURSE sources src/main/cpp/templates/${template}/cpp/*.cpp
|
||||
src/main/cpp/templates/${template}/c/*.c)
|
||||
add_executable(${template} ${sources})
|
||||
wpilib_target_warnings(${template})
|
||||
target_include_directories(${template} PUBLIC src/main/cpp/templates/${template}/include)
|
||||
target_link_libraries(${template} wpilibc wpilibNewCommands)
|
||||
endforeach()
|
||||
|
||||
@@ -19,6 +19,6 @@ class ExampleGlobalMeasurementSensor {
|
||||
return frc::Pose2d{estimatedRobotPose.X() + units::meter_t{randVec(0)},
|
||||
estimatedRobotPose.Y() + units::meter_t{randVec(1)},
|
||||
estimatedRobotPose.Rotation() +
|
||||
frc::Rotation2d{units::radian_t{randVec(3)}}};
|
||||
frc::Rotation2d{units::radian_t{randVec(2)}}};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,7 +51,7 @@ class RobotContainer {
|
||||
OnBoardIO::ChannelMode::INPUT};
|
||||
|
||||
// Example button
|
||||
frc2::Button m_onboardButtonA{
|
||||
frc2::Trigger m_onboardButtonA{
|
||||
[this] { return m_onboardIO.GetButtonAPressed(); }};
|
||||
|
||||
// Autonomous commands.
|
||||
|
||||
@@ -19,6 +19,6 @@ class ExampleGlobalMeasurementSensor {
|
||||
return frc::Pose2d{estimatedRobotPose.X() + units::meter_t{randVec(0)},
|
||||
estimatedRobotPose.Y() + units::meter_t{randVec(1)},
|
||||
estimatedRobotPose.Rotation() +
|
||||
frc::Rotation2d{units::radian_t{randVec(3)}}};
|
||||
frc::Rotation2d{units::radian_t{randVec(2)}}};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user