From 75c3586affa64fbf6475acdb6c4b500310e9e512 Mon Sep 17 00:00:00 2001 From: kurte Date: Fri, 11 Aug 2023 14:19:46 -0700 Subject: [PATCH] Reduce the number of compiler warnings Resolves #77 At least partially. I did not go into the API class to fix the printf statement issue. --- cores/arduino/IRQManager.cpp | 10 +++++----- cores/arduino/cm_backtrace/cm_backtrace.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cores/arduino/IRQManager.cpp b/cores/arduino/IRQManager.cpp index 73036ffe8..f7186fc1c 100644 --- a/cores/arduino/IRQManager.cpp +++ b/cores/arduino/IRQManager.cpp @@ -342,7 +342,7 @@ bool IRQManager::addPeripheral(Peripheral_t p, void *cfg) { if(p == IRQ_USB && cfg != NULL) { USBIrqCfg_t *irqcfg = (USBIrqCfg_t *)cfg; - if (irqcfg->first_irq_number != FSP_INVALID_VECTOR) { + if (irqcfg->first_irq_number != (uint32_t)FSP_INVALID_VECTOR) { // already configured, return goto end_config; } @@ -405,7 +405,7 @@ bool IRQManager::addPeripheral(Peripheral_t p, void *cfg) { else if(p == IRQ_USB_HS && cfg != NULL) { USBIrqCfg_t *irqcfg = (USBIrqCfg_t *)cfg; - if (irqcfg->first_irq_number != FSP_INVALID_VECTOR) { + if (irqcfg->first_irq_number != (uint32_t)FSP_INVALID_VECTOR) { // already configured, return goto end_config; } @@ -1659,7 +1659,7 @@ void IRQManager::set_can_tx_link_event(int li, int ch) #endif } -void IRQManager::set_canfd_error_link_event(int li, int ch) +void IRQManager::set_canfd_error_link_event(__attribute__((unused)) int li, __attribute__((unused)) int ch) { if (0) {} #ifdef ELC_EVENT_CAN0_CHERR @@ -1674,7 +1674,7 @@ void IRQManager::set_canfd_error_link_event(int li, int ch) #endif } -void IRQManager::set_canfd_rx_link_event(int li, int ch) +void IRQManager::set_canfd_rx_link_event(__attribute__((unused)) int li, __attribute__((unused)) int ch) { if (0) {} #ifdef ELC_EVENT_CAN0_COMFRX @@ -1689,7 +1689,7 @@ void IRQManager::set_canfd_rx_link_event(int li, int ch) #endif } -void IRQManager::set_canfd_tx_link_event(int li, int ch) +void IRQManager::set_canfd_tx_link_event(__attribute__((unused)) int li, __attribute__((unused)) int ch) { if (0) {} #ifdef ELC_EVENT_CAN0_TX diff --git a/cores/arduino/cm_backtrace/cm_backtrace.c b/cores/arduino/cm_backtrace/cm_backtrace.c index 2707da1a1..53037a914 100644 --- a/cores/arduino/cm_backtrace/cm_backtrace.c +++ b/cores/arduino/cm_backtrace/cm_backtrace.c @@ -117,9 +117,9 @@ static const char * const print_info[] = { #endif }; -static char* fw_name; -static char* hw_ver; -static char* sw_ver; +static const char* fw_name; +static const char* hw_ver; +static const char* sw_ver; static uint32_t main_stack_start_addr = 0; static size_t main_stack_size = 0; static uint32_t code_start_addr = 0;