Skip to content
This repository was archived by the owner on Dec 18, 2025. It is now read-only.

conversion warnings for __NVIC_SetVector and __NVIC_GetVector  #1673

@bassemaed

Description

@bassemaed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions