Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conversion warnings for __NVIC_SetVector and __NVIC_GetVector #1673

Open
bassemaed opened this issue Jul 30, 2024 · 1 comment
Open

conversion warnings for __NVIC_SetVector and __NVIC_GetVector #1673

bassemaed opened this issue Jul 30, 2024 · 1 comment

Comments

@bassemaed
Copy link

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

@JonatanAntoni
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants