Quantcast
Channel: Intel® C++ Compiler
Viewing all articles
Browse latest Browse all 1616

-Wtype-limits support

$
0
0

Hi,

I used the same compiler flags of gcc when using icc. So, when I used -Wall and -Wextra for the below code, I was expecting a warning of pointless comparison (which is always true) from icc. However, I got no warning and it seems -Wtype-limits is not included in -Wall or -Wextra. Actually, -Wextra of gcc enables -Wtype-limits.

#include <stdio.h>

int main()
{
    size_t off = 10;
    if (off >= 0) {
        printf("off=%lu\n", off);
    }
    return 0;
}

If I explicitly use -Wtype-limits, icc generates the warning:

warning.c(6): warning #186: pointless comparison of unsigned integer with zero

      if (off >= 0) {

My question is whether -Wtype-limits is officially supported in the Intel Compiler or not. If so, I also want to know if it is documented somewhere. I could not find any information about -Wtype-limits from the Intel Compiler manual or man page.

Thanks in advance,

Sangmin


Viewing all articles
Browse latest Browse all 1616

Trending Articles



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