NO

Author Topic: If inline function is present /Wd2135 doesn't work anymore  (Read 409 times)

Offline FRex

  • Member
  • *
  • Posts: 4
If inline function is present /Wd2135 doesn't work anymore
« on: March 18, 2019, 07:55:30 pm »
Code: (C) [Select]
static void bad1(void){}
inline void bad2(void){}
int main(void){return 0;}

The above is the example code. I've originally tracked it down inside a bigger program where this happened.

Compiling it with cc /Wd2135 will produce warning #2135: Static 'bad1' is not referenced.

It seems that presence of inline function in a given file/TU makes /Wd2135 stop working.

If bad2 is commented out or the inline removed from it then the /Wd2135 option correctly disables the warning.