0

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

Frant
  • 5,382
  • 1
  • 16
  • 22
Federico
  • 1,117
  • 6
  • 20
  • 37
  • `Code Analysis Problem` Are you _sure_ this is a message from gcc? Please post the full gcc message as it is printed by gcc. – KamilCuk Nov 25 '20 at 11:47
  • @KamilCuk you are right! Looking into the Eclipse Probolem windows, the type colum reports "Code Analysis Problem". – Federico Nov 25 '20 at 11:50
  • Then go to eclipse settings and disable detecting that problem. – KamilCuk Nov 25 '20 at 11:56

1 Answers1

0

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

Federico
  • 1,117
  • 6
  • 20
  • 37