Skip to content

Commit e2567e5

Browse files
author
Cruz Monrreal
authored
Merge pull request #6599 from jeromecoutant/PR_WARNING
STM32 compilation warning issues
2 parents fe44dc0 + 71d7d24 commit e2567e5

File tree

30 files changed

+126
-48
lines changed

30 files changed

+126
-48
lines changed

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F2/TARGET_NUCLEO_F207ZG/stm32f2_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
8484
/* Disable the Ethernet global Interrupt */
8585
NVIC_DisableIRQ(ETH_IRQn);
8686
}
87-
}
87+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F4/TARGET_ARCH_MAX/stm32f4_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
7878
/* Disable the Ethernet global Interrupt */
7979
NVIC_DisableIRQ(ETH_IRQn);
8080
}
81-
}
81+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F4/TARGET_MTB_UBLOX_ODIN_W2/stm32f4_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,4 +156,4 @@ uint8_t mbed_otp_mac_address(char *mac)
156156
memcpy(mac, _macAddr, 6);
157157

158158
return 1;
159-
}
159+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F429ZI/stm32f4_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
8484
/* Disable the Ethernet global Interrupt */
8585
NVIC_DisableIRQ(ETH_IRQn);
8686
}
87-
}
87+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F439ZI/stm32f4_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
8484
/* Disable the Ethernet global Interrupt */
8585
NVIC_DisableIRQ(ETH_IRQn);
8686
}
87-
}
87+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F746ZG/stm32f7_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
8686
/* Disable the Ethernet global Interrupt */
8787
NVIC_DisableIRQ(ETH_IRQn);
8888
}
89-
}
89+
}

features/FEATURE_LWIP/lwip-interface/lwip-eth/arch/TARGET_STM/TARGET_STM32F7/TARGET_NUCLEO_F756ZG/stm32f7_eth_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,4 @@ void HAL_ETH_MspDeInit(ETH_HandleTypeDef* heth)
8686
/* Disable the Ethernet global Interrupt */
8787
NVIC_DisableIRQ(ETH_IRQn);
8888
}
89-
}
89+
}

targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_hal_crc.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t
421421
* @{
422422
*/
423423

424+
#if __GNUC__
425+
# define MAY_ALIAS __attribute__ ((__may_alias__))
426+
#else
427+
# define MAY_ALIAS
428+
#endif
429+
430+
typedef __IO uint8_t MAY_ALIAS uint8_io_t;
431+
typedef __IO uint16_t MAY_ALIAS uint16_io_t;
432+
424433
/**
425434
* @brief Return the CRC handle state.
426435
* @param hcrc CRC handle
@@ -468,16 +477,16 @@ static uint32_t CRC_Handle_8(CRC_HandleTypeDef *hcrc, uint8_t pBuffer[], uint32_
468477
{
469478
if (BufferLength%4U == 1U)
470479
{
471-
*(uint8_t volatile*) (&hcrc->Instance->DR) = pBuffer[4*i];
480+
*(uint8_io_t*) (&hcrc->Instance->DR) = pBuffer[4*i];
472481
}
473482
if (BufferLength%4U == 2U)
474483
{
475-
*(uint16_t volatile*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4*i]<<8) | (uint32_t)pBuffer[4*i+1];
484+
*(uint16_io_t*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4*i]<<8) | (uint32_t)pBuffer[4*i+1];
476485
}
477486
if (BufferLength%4U == 3U)
478487
{
479-
*(uint16_t volatile*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4*i]<<8) | (uint32_t)pBuffer[4*i+1];
480-
*(uint8_t volatile*) (&hcrc->Instance->DR) = pBuffer[4*i+2];
488+
*(uint16_io_t*) (&hcrc->Instance->DR) = ((uint32_t)pBuffer[4*i]<<8) | (uint32_t)pBuffer[4*i+1];
489+
*(uint8_io_t*) (&hcrc->Instance->DR) = pBuffer[4*i+2];
481490
}
482491
}
483492

@@ -508,7 +517,7 @@ static uint32_t CRC_Handle_16(CRC_HandleTypeDef *hcrc, uint16_t pBuffer[], uint3
508517
}
509518
if ((BufferLength%2U) != 0U)
510519
{
511-
*(uint16_t volatile*) (&hcrc->Instance->DR) = pBuffer[2*i];
520+
*(uint16_io_t*) (&hcrc->Instance->DR) = pBuffer[2*i];
512521
}
513522

514523
/* Return the CRC computed value */

targets/TARGET_STM/TARGET_STM32F0/device/stm32f0xx_ll_spi.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,14 @@ __STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData)
13761376
*((__IO uint8_t *)&SPIx->DR) = TxData;
13771377
}
13781378

1379+
#if __GNUC__
1380+
# define MAY_ALIAS __attribute__ ((__may_alias__))
1381+
#else
1382+
# define MAY_ALIAS
1383+
#endif
1384+
1385+
typedef __IO uint16_t MAY_ALIAS uint16_io_t;
1386+
13791387
/**
13801388
* @brief Write 16-Bits in the data register
13811389
* @rmtoll DR DR LL_SPI_TransmitData16
@@ -1385,7 +1393,7 @@ __STATIC_INLINE void LL_SPI_TransmitData8(SPI_TypeDef *SPIx, uint8_t TxData)
13851393
*/
13861394
__STATIC_INLINE void LL_SPI_TransmitData16(SPI_TypeDef *SPIx, uint16_t TxData)
13871395
{
1388-
*((__IO uint16_t *)&SPIx->DR) = TxData;
1396+
*((uint16_io_t*)&SPIx->DR) = TxData;
13891397
}
13901398

13911399
/**

targets/TARGET_STM/TARGET_STM32F0/serial_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ UART_HandleTypeDef uart_handlers[UART_NUM];
4848
static uart_irq_handler irq_handler;
4949

5050
// Defined in serial_api.c
51-
inline int8_t get_uart_index(UARTName uart_name);
51+
extern int8_t get_uart_index(UARTName uart_name);
5252

5353
/******************************************************************************
5454
* INTERRUPTS HANDLING

0 commit comments

Comments
 (0)