- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I wrote a small snippet as follows:
/******warning.c*****/
typedef struct _node {
unsigned int var_32:16;
char var_8;
}node;
int main()
{
unsigned long long y = 6;
node local_node;
local_node.var_32 = (unsigned int) (y & 0xFFFF);
return 0;
}
and compiled as icl /c /Wp64 warning.c and got an error
error #2259: non-pointer conversion from "unsigned __int64" to "unsigned int" may lose significant bits
Then I renamed the file as warning.cpp and compiled again with same option but did not get any error. Then I tried with VC2005 (cl /c /Wp64 warning.c) and still no error. Then why only ICL is giving an error. (I know the reason why I am getting it. But I wonder why others are not giving the same error.)
Thanks,
Abhi
I wrote a small snippet as follows:
/******warning.c*****/
typedef struct _node {
unsigned int var_32:16;
char var_8;
}node;
int main()
{
unsigned long long y = 6;
node local_node;
local_node.var_32 = (unsigned int) (y & 0xFFFF);
return 0;
}
and compiled as icl /c /Wp64 warning.c and got an error
error #2259: non-pointer conversion from "unsigned __int64" to "unsigned int" may lose significant bits
Then I renamed the file as warning.cpp and compiled again with same option but did not get any error. Then I tried with VC2005 (cl /c /Wp64 warning.c) and still no error. Then why only ICL is giving an error. (I know the reason why I am getting it. But I wonder why others are not giving the same error.)
Thanks,
Abhi
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel compiler should give warning with following command:
icl /c /Wp64 /Qdiag-enable:sc3 warning.cpp
In the avove testcase it is not emitting this warning. This seems bug to me.
icl /c /Wp64 /Qdiag-enable:sc3 warning.cpp
In the avove testcase it is not emitting this warning. This seems bug to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Compiler should givewarning using the following command line:
icl /c /Wp64 /Qdiag-enable:sc3 warning.cpp
In the current test case no warning is emmited. This seems a bug to me.
icl /c /Wp64 /Qdiag-enable:sc3 warning.cpp
In the current test case no warning is emmited. This seems a bug to me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey, I kinda of found a reason. On VC2005 64 bit compilatation,/Wp64 is depricated. So I dont get any error on VC2005 or VC2008. But I wonder why Intel has kept it for 64bit compilation. (I am refering to Intel 64bit compiler.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The option has not been removed yet even in VS2010. I think if you use theoption in command line it should still give error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That is not a very good test case.
Here is a detailed explanation how to use /Wp64 properly:
http://www.viva64.com/en/a/0021/
Here is a detailed explanation how to use /Wp64 properly:
http://www.viva64.com/en/a/0021/

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