is stm32CubeIDE use C MISRA 2004 Compliance
All in the title.
I'm asking this question because I have compilation warning inside a library that I included in my project. And inside the source-code of this library, there is a mention about rules of C MISRA-2004 that are not respected.
Here is the mention :
The warning concern an union (like Rule 18.4 that is not respected).
Here is the warning :
C:/Users/xxxx/ST/BlueNRG-1_2 DK 3.2.3(v4.0)/Library/CMSIS/Device/ST/BlueNRG1/Include/BlueNRG1.h:1541:5: warning: no semicolon at end of struct or union
1541 | } CLOCK_EN_b;
Here is the (simplified) struct that provoke the warning :
typedef struct { /*!< (@ 0x40900000) CKGEN_SOC Structure */
__IM uint32_t RESERVED[2];
union {
__IM uint8_t REASON_RST; /*!< (@ 0x00000008) Indicates the reset reason from Cortex-M0 */
struct {
__IM uint8_t : 1;
} REASON_RST_b;
} ;
__IM uint8_t RESERVED1;
union {
__IM uint32_t DIE_ID; /*!< (@ 0x0000001C) Identification information of the device */
struct {
__IM uint32_t REV : 4; /*!< [3..0] Cut revision */ */
} DIE_ID_b;
} ;
union {
__IOM uint32_t CLOCK_EN; /*!< (@ 0x00000020) Enable or gates the APB clock of the peripherals */
struct {
__IOM uint32_t GPIO : 1; /*!< [0..0] GPIO clock */ */
} CLOCK_EN_b;
} ;
union {
__IOM uint8_t DMA_CONFIG; /*!< (@ 0x00000024) DMA config */
struct {
__IOM uint8_t ADC_CH0 : 1; /*!< [0..0] Select ADC on DMA channel 0 instead of peripheral */
} DMA_CONFIG_b;
} ;
__IM uint8_t RESERVED4;
__IM uint16_t RESERVED5;
} CKGEN_SOC_Type; /*!< Size = 40 (0x28)
So I read the rule 18.4 of MISRA C 2004 compliance, and surprisingly, I didnt fount any
information and how a union in a struct should be write in code.
Thanks for help !
