- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It seems I either have forgotten how C works, or ICC has a very basic (and thus very serious bug).
When compiling x = a
I am using the latest ICC (14.0.2). This toy code shows this:
#include <stdio.h>
int main(void)
{
int a[1] = {5}, i = 0;
i = a++;
printf("%d %d\n", i, a[0]);
return 0;
}
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, I found that since there is a double memory reference, the ordering of "++" is undefined by the C standard.
But why does it not generate a warning at least ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have submitted a report to Intel Compiler development team and requested to issue the warning in this situation.
Om

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