Quantcast
Viewing all articles
Browse latest Browse all 1175

The behavior ICC triggers unused_function warning is odd

I'm using ICC Version 19.0.6 Build 20191202 to build on Ubuntu 18.04.1.  

I found that the warning [-Wunused_function] only take class into consideration, meaning if the member function of a class is never referenced, it trigger the warning, however while if a free function is never referenced, no such warning will be shown. I also try on GCC, which shows a opposite behavior.

For example, the following cpp codes will trigger no warning by ICC, but a warning [-Wunused_function] by GCC.

static void SFoo() { return;}

int main()
{
    return 0;
}

 

Is the behavior of ICC expected?  

 

TCE Open Date: 

Friday, February 21, 2020 - 01:13

Viewing all articles
Browse latest Browse all 1175

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>