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

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

If i compile the attached code asicl try.c --> it is going fineicl/Wp64 try.c --> it is giving me below warnings.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 ) )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 x64icl version :: 12.0.5

5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Quoting Naveen TulabandulaIf i compile the attached code as icl try.c --> it is going fineicl/Wp64 try.c --> it is giving me below warnings.try.c(100): warning #2259: non-pointer conversion from "unsigned __int64" to "WORD={unsigned short}" may lose significant bits if( HIWORD( dwFileVersionMS ) < 6 || ^
...How to get rid of these warnings with /Wp64 flag on ?

platform :: win2k8 R2 x64icl 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

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

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.

Quoting Sergey Kostrov...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 ).

Leave a Comment

Please sign in to add a comment. Not a member? Join today