Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7939 Discussions

why am i getting these warnings when i use /Wp64 flag

Naveen_Tulabandula
831 Views
If i compile the attached code as
icl try.c --> it is going fine
icl/Wp64 try.c --> it is giving me below warnings.
try.c(100): warning #2259: non-pointer conversion from "unsigned __int64" to "WO
RD={unsigned short}" may lose significant bits
if( HIWORD( dwFileVersionMS ) < 6 ||
^
try.c(101): warning #2259: non-pointer conversion from "unsigned __int64" to "WO
RD={unsigned short}" may lose significant bits
( HIWORD( dwFileVersionMS ) == 6 &&
^
try.c(102): warning #2259: non-pointer conversion from "unsigned __int64" to "WO
RD={unsigned short}" may lose significant bits
LOWORD( dwFileVersionMS ) == 8 &&
^
try.c(103): warning #2259: non-pointer conversion from "unsigned __int64" to "WO
RD={unsigned short}" may lose significant bits
HIWORD( dwFileVersionLS ) < 4 ) )
try.c(100): warning #2259: non-pointer conversion from "unsigned __int64" to "WORD={unsigned short}" may lose significant bits if( HIWORD( dwFileVersionMS ) < 6 || ^
try.c(101): warning #2259: non-pointer conversion from "unsigned __int64" to "WORD={unsigned short}" may lose significant bits ( HIWORD( dwFileVersionMS ) == 6 && ^
try.c(102): warning #2259: non-pointer conversion from "unsigned __int64" to "WORD={unsigned short}" may lose significant bits LOWORD( dwFileVersionMS ) == 8 && ^
try.c(103): warning #2259: non-pointer conversion from "unsigned __int64" to "WORD={unsigned short}" may lose significant bits HIWORD( dwFileVersionLS ) < 4 ) )
How to get rid of these warnings with /Wp64 flag on ?
platform :: win2k8 R2 x64
icl version :: 12.0.5
0 Kudos
4 Replies
SergeyKostrov
Valued Contributor II
831 Views
If i compile the attached code as
icl try.c --> it is going fine
icl/Wp64 try.c --> it is giving me below warnings.
try.c(100): warning #2259: non-pointer conversion from "unsigned __int64" to "WO
RD={unsigned short}" may lose significant bits
if( HIWORD( dwFileVersionMS ) < 6 ||
^
...
How to get rid of these warnings with /Wp64 flag on ?

platform :: win2k8 R2 x64
icl version :: 12.0.5


If you're absolutely confident that everything iscorrect with your codes try to disable the Warning #2259 with a directive:

#pragma warning ( disable : 2259 )// Non-pointer conversion from "type1" to "type2" may lose significant bits

Please take into account that this is Intel C++ compiler specific warning. In case of Microsoft C++ compiler you will
have a warning with a different number.

Best regards,
Sergey

0 Kudos
SergeyKostrov
Valued Contributor II
831 Views
Please take a look at a thread related to 64-bit programming:

"Tips for Porting software to a 64-bit platform"

http://software.intel.com/en-us/forums/showthread.php?t=106025&o=a&s=lr

I willmake new posts related to warning messages for different C++ compilers.

Best regards,
Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
831 Views

Here is a small Test-Case:

...
DWORD dwFileVersionMS = 1;
if( HIWORD( dwFileVersionMS ) < 6 )
{
RTint x = -1;
}
else
{
RTint x = -2;
}
...

Microsoft C++ compiler doesn't display any warnings.

0 Kudos
SergeyKostrov
Valued Contributor II
831 Views
...this is Intel C++ compiler specific warning. In case of Microsoft C++ compiler you will
have a warning with a different number
.


I don't confirm this and please see my comment in aprevious post (#3 ).

0 Kudos
Reply