Schwabe/silence register warnings clang (#3940)
* Ignore deprecated register warning for the the STM include files Ignore the warning with the use of #pragma which is not elegant but otherwise we would have to change the vendor files * Remove usage of register in C/C++ files. Modern compilers ignore it anyway and C++11 actually deprecates it. Removing also removes a number of clang warnings about this
This commit is contained in:
committed by
Bertrand Songis
parent
ba824537d4
commit
ad8cd2546e
@@ -27,6 +27,13 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if __clang__
|
||||
// clang is very picky about the use of "register"
|
||||
// Tell clang to ignore the warnings for the following files
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
#endif
|
||||
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_rcc.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_gpio.h"
|
||||
@@ -44,7 +51,12 @@ extern "C" {
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_tim.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_dma2d.h"
|
||||
#include "STM32F4xx_DSP_StdPeriph_Lib_V1.4.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/misc.h"
|
||||
#if __clang__
|
||||
// Restore warnings about registers
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(SIMU)
|
||||
#include "usbd_cdc_core.h"
|
||||
#include "usbd_msc_core.h"
|
||||
|
||||
@@ -93,7 +93,7 @@ uint8_t keyDown()
|
||||
|
||||
void checkRotaryEncoder()
|
||||
{
|
||||
register uint32_t newpos = ROTARY_ENCODER_POSITION();
|
||||
uint32_t newpos = ROTARY_ENCODER_POSITION();
|
||||
if (newpos != rotencPosition) {
|
||||
if ((rotencPosition & 0x01) ^ ((newpos & 0x02) >> 1)) {
|
||||
--rotencValue[0];
|
||||
@@ -108,7 +108,7 @@ void checkRotaryEncoder()
|
||||
/* TODO common to ARM */
|
||||
void readKeysAndTrims()
|
||||
{
|
||||
register uint32_t i;
|
||||
uint32_t i;
|
||||
|
||||
uint8_t index = 0;
|
||||
uint32_t in = readKeys();
|
||||
@@ -161,7 +161,7 @@ uint8_t keyState(uint8_t index)
|
||||
|
||||
uint32_t switchState(uint8_t index)
|
||||
{
|
||||
register uint32_t xxx = 0;
|
||||
uint32_t xxx = 0;
|
||||
|
||||
switch (index) {
|
||||
ADD_3POS_CASE(A, 0);
|
||||
|
||||
Reference in New Issue
Block a user