arduino / ArduinoCore-mbed

329 stars 192 forks source link

`-Wunused-variable` compiler warnings #923

Open zfields opened 1 month ago

zfields commented 1 month ago
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp: In member function 'uint8_t STM32H747::readReg(uint8_t)':
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp:9:8: warning: unused variable 'response' [-Wunused-variable]
   char response = 0xFF;
        ^~~~~~~~
In file included from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_rcc.h:29:0,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/stm32h7xx_hal_conf.h:398,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal.h:30,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/CMSIS/stm32h7xx.h:223,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/cmsis.h:22,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/PinNamesTypes.h:33,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/variants/OPTA/pinmode_arduino.h:24,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/Arduino.h:26,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.h:4,
                 from ~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp:1:
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp: In member function 'bool STM32H747::useInternalOscillator(bool)':
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_pwr.h:286:14: warning: conversion to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
       UNUSED(tmpreg);                                                          \
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_def.h:70:27: note: in definition of macro 'UNUSED'
 #define UNUSED(x) ((void)(x))
                           ^
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp:109:5: note: in expansion of macro '__HAL_PWR_VOLTAGESCALING_CONFIG'
     __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3);
     ^
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_pwr.h:286:14: warning: conversion to void will not access object of type 'volatile uint32_t {aka volatile long unsigned int}'
       UNUSED(tmpreg);                                                          \
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/cores/arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_def.h:70:27: note: in definition of macro 'UNUSED'
 #define UNUSED(x) ((void)(x))
                           ^
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp:111:5: note: in expansion of macro '__HAL_PWR_VOLTAGESCALING_CONFIG'
     __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
     ^
~/.arduino15/packages/arduino/hardware/mbed_opta/4.1.5/libraries/STM32H747_System/src/STM32H747_System.cpp:47:28: warning: unused variable 'PeriphClkInitStruct' [-Wunused-variable]
   RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
                            ^~~~~~~~~~~~~~~~~~~
zfields commented 1 month ago

arduino-cli compile --verbose --warnings=all --build-property "build.extra_flags=-Wno-implicit-fallthrough -Wno-psabi -Wno-deprecated-copy -Wno-missing-field-initializers -Wno-vla -Wno-delete-non-virtual-dtor -Wno-sign-compare -Og -g" --fqbn arduino:mbed_opta:opta <dev folder>