CMSIS_5 icon indicating copy to clipboard operation
CMSIS_5 copied to clipboard

conversion warnings for __NVIC_SetVector and __NVIC_GetVector

Open bassemaed opened this issue 1 year ago • 1 comments

Describe the set-up

MCU: STM32G474VETx IDE: STM32CubeIDE Libraries: Using the same library files provided in this repository *Problem Description:

Objective: Activate the -Werror flag for the entire project. Encountered Errors: Receiving errors due to conversion warnings from functions in core_cm4.h, specifically the functions __NVIC_SetVector (line 1905) and __NVIC_GetVector (line 1921). Error Details: Conversion Warning: Error Message: conversion to 'int' from 'uint32_t' {aka 'long unsigned int'} may change the sign of the result [-Werror=sign-conversion] File: core_cm4.h Path: /Drivers/CMSIS/Include Line: 1908 Type: C/C++ Problem

Sign-Conversion Warning: Error Message: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Werror=sign-conversion] File: core_cm4.h Path: /Drivers/CMSIS/Include Line: 1908 Type: C/C++ Problem

Sign-Conversion Warning: Error Message: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Werror=sign-conversion] File: core_cm4.h Path: /DCDC_MCU/Drivers/CMSIS/Include Line: 1924 Type: C/C++ Problem

Additional context This can be ommitted by using #pragma

bassemaed avatar Jul 30 '24 12:07 bassemaed

Hi @bassemaed,

Can you elaborate a bit more on your specific issue? Bit shifting is always a hassle in C/C++.

Pragmas can hardly be used as these are compiler specific and the CMSIS header files are intended to be compiler agnostic. If no other solution can be found, we need to add compiler specific pragmas to get around this issue.

Please be aware that we don't intend to have another release of the CMSIS 5 series. Instead, active development has moved to CMSIS 6.

JonatanAntoni avatar Jul 30 '24 12:07 JonatanAntoni