mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +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:
@@ -125,8 +125,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
// CS0 is not a DIO port, so nothing to allocate
|
||||
handle = open("/dev/spidev0.0", O_RDWR);
|
||||
if (handle < 0) {
|
||||
fmt::print("Failed to open SPI port {}: {}\n", port,
|
||||
std::strerror(errno));
|
||||
fmt::print("Failed to open SPI port {}: {}\n",
|
||||
static_cast<int32_t>(port), std::strerror(errno));
|
||||
CommonSPIPortFree();
|
||||
return;
|
||||
}
|
||||
@@ -147,8 +147,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
}
|
||||
handle = open("/dev/spidev0.1", O_RDWR);
|
||||
if (handle < 0) {
|
||||
fmt::print("Failed to open SPI port {}: {}\n", port,
|
||||
std::strerror(errno));
|
||||
fmt::print("Failed to open SPI port {}: {}\n",
|
||||
static_cast<int32_t>(port), std::strerror(errno));
|
||||
CommonSPIPortFree();
|
||||
HAL_FreeDIOPort(digitalHandles[0]);
|
||||
return;
|
||||
@@ -170,8 +170,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
}
|
||||
handle = open("/dev/spidev0.2", O_RDWR);
|
||||
if (handle < 0) {
|
||||
fmt::print("Failed to open SPI port {}: {}\n", port,
|
||||
std::strerror(errno));
|
||||
fmt::print("Failed to open SPI port {}: {}\n",
|
||||
static_cast<int32_t>(port), std::strerror(errno));
|
||||
CommonSPIPortFree();
|
||||
HAL_FreeDIOPort(digitalHandles[1]);
|
||||
return;
|
||||
@@ -193,8 +193,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
}
|
||||
handle = open("/dev/spidev0.3", O_RDWR);
|
||||
if (handle < 0) {
|
||||
fmt::print("Failed to open SPI port {}: {}\n", port,
|
||||
std::strerror(errno));
|
||||
fmt::print("Failed to open SPI port {}: {}\n",
|
||||
static_cast<int32_t>(port), std::strerror(errno));
|
||||
CommonSPIPortFree();
|
||||
HAL_FreeDIOPort(digitalHandles[2]);
|
||||
return;
|
||||
@@ -240,8 +240,8 @@ void HAL_InitializeSPI(HAL_SPIPort port, int32_t* status) {
|
||||
digitalSystem->readEnableMXPSpecialFunction(status) | 0x00F0, status);
|
||||
handle = open("/dev/spidev1.0", O_RDWR);
|
||||
if (handle < 0) {
|
||||
fmt::print("Failed to open SPI port {}: {}\n", port,
|
||||
std::strerror(errno));
|
||||
fmt::print("Failed to open SPI port {}: {}\n",
|
||||
static_cast<int32_t>(port), std::strerror(errno));
|
||||
HAL_FreeDIOPort(digitalHandles[5]); // free the first port allocated
|
||||
HAL_FreeDIOPort(digitalHandles[6]); // free the second port allocated
|
||||
HAL_FreeDIOPort(digitalHandles[7]); // free the third port allocated
|
||||
|
||||
Reference in New Issue
Block a user