How do I update the CMSIS used by a project?
I've created a project for an STM32G031 device, but the code does not build cleanly with -Wsign-conversion due to some "nasty" stuff in the CMSIS core_cm0plus.h file:
../Drivers/CMSIS/Include/core_cm0plus.h: In function '__NVIC_SetVector':
../Drivers/CMSIS/Include/core_cm0plus.h:964:23: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
964 | (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector;
| ^
../Drivers/CMSIS/Include/core_cm0plus.h:964:72: warning: conversion to 'int' from 'uint32_t' {aka 'long unsigned int'} may change the sign of the result [-Wsign-conversion]
964 | (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector;
| ^~~~~~
../Drivers/CMSIS/Include/core_cm0plus.h: In function '__NVIC_GetVector':
../Drivers/CMSIS/Include/core_cm0plus.h:984:40: warning: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Wsign-conversion]
984 | return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4));The file is for CMSIS V5.0.7. V6.1.0 looks like it fixed this.
Is is possible to select a different version of CMSIS within the project?
For now, I've just wrapped the affected code with a GCC diagnostic ignored "-Wsign-conversion" pragma, but I would prefer to use files that are not modified within the project so that it does not have to take ownership of them.
--
Edited to fix a typo.
