Suppress "Unused declaration of function" warning GCC

528 views Asked by At

I'm trying to suppress "Unused declaration of function" warning in GCC into a third party file for an embedded system.

I tried every combination of pragma attribute((unused)) but the warnig is still there.

This is the declaration of a weak function:

void __attribute__ ((weak, alias ("Default_Handler")))
ADC1_IRQHandler(void);

And this is the waring:

Description Resource Path Location Type Unused declaration of function 'ADC1_IRQHandler' vectors_stm32f0xx.c /FW00_Application/system/src/cmsis line 44 Code Analysis Problem

I tried:

void __attribute__ ((weak, unused, alias ("Default_Handler")))
ADC1_IRQHandler(void);

and:

void __attribute__ ((weak, alias ("Default_Handler")))  __attribute__ ((unused))
ADC1_IRQHandler(void);

Any help is appreciated!

Thanks!

BR, Federico

1

There are 1 answers

0
Federico On

The warning is related to "Eclipse Code Analysis" feature not to GCC.