[C/C++] Floating point comparisons with NaN giving inconsistent results

You might notice that when comparing with NaN, the comparison gives wrong results at least for x64 builds. Take a look at the following piece of code. If you run this sample application the comparison statement if(lfv==0.0) returns true and the MessageBox is displayed. (We had a customer who reported this behavior.) #include “stdafx.h” #include […]
Continue reading…

 

Hidden VC++ compiler switches: /showIncludes

This hidden Visual C++ compiler switch will print out the full path of files included via #includes. You add this option likewise… Sample output… 1>  Note: including file:  C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfcincludeafxwin.h 1>  Note: including file:   C:Program Files (x86)Microsoft Visual Studio 10.0VCatlmfcincludeafx.h 1>  Note: including file:    C:Program Files (x86)Microsoft Visual Studio 10.0VCincludenew.h 1>  […]
Continue reading…

 

__noop intrinsic

What do we mean by intrinsic? Most functions are contained in libraries, but some functions are built in (that is, intrinsic) to the compiler. These are referred to as intrinsic functions or intrinsics. Taken from MSDN… The __noop intrinsic specifies that a function should be ignored and the argument list be parsed but no code […]
Continue reading…