- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We do not re-document all the -W options ourselves since they are supposed to be compatible with the GNU options. Please look at the GNU man page or online docs. We only document options that are specific to Intel or are intentionally different when used with Intel.
It sounds like the -Wtype-limits option is working as expected (or else you would have gotten a warning from the driver about ignoring an unknown option).
The only problem seems to be that it not included in -Wextra, is that correct? I have submitted a problem report for that as :DPD200357763.
Thanks for letting us know.
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, -Wtype-limits flag is currently working in icc but it is not included in -Wextra.
Thanks for the reply.
Sangmin

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page