6

I have used -Wall -Werror in my Makefile but I want to disable following specific type of warning :

 warning: '_wrap_delete_DMXTSFILTER' defined but not used

How shoud I do that?

pierrotlefou
  • 39,805
  • 37
  • 135
  • 175
  • Would not the correct way of doing this be to only `#define` it if it is going to be used? – Kimvais Apr 09 '10 at 06:44
  • Possible duplicate of [How can I hide "defined but not used" warnings in GCC?](http://stackoverflow.com/questions/386220/how-can-i-hide-defined-but-not-used-warnings-in-gcc) – Praetorian Jan 07 '16 at 22:35

3 Answers3

6

This way

Community
  • 1
  • 1
RarrRarrRarr
  • 3,712
  • 1
  • 20
  • 14
2

Assuming it's unused variable:

-Wno-unused-variable
stefanB
  • 77,323
  • 27
  • 116
  • 141
1

Finnaly, I used this trick __attribute__((unused)). The advantage is I could apply it to individual functions / variables instead of the whole source file which the -Wno-unsed-xxxxx will apply on.

pierrotlefou
  • 39,805
  • 37
  • 135
  • 175