📜 ⬆️ ⬇️

Changes in Visual C ++

When you want to upgrade your version of the Visual C ++ compiler (for example, to switch from Visual Studio from 2013 to 2015), it will not be superfluous to know why you may encounter that the code that was successfully compiled and executed before will now cause compilation errors and / or runtime errors.
These problems can be caused by numerous compiler changes to conform to the C ++ standard, changes in function signatures, or changes in the location of objects in memory.

In order to avoid runtime errors (which are known to be the most difficult to find), we recommend never doing static linking with binary files obtained by another version of the compiler. Also when updating your program (EXE or DLL), make sure that the libraries used are also compiled with the new version of the compiler.
If you use types from CRT (C Runtime) or STL (Standard Template Library), do not transfer them between binary files (including DLLs) that are compiled by different versions of the compiler. This issue is discussed in more detail in Potential Errors Passing CRT Objects Across DLL Boundaries .
And in the future, we recommend not to write code that depends on the specific location of objects in memory (if it is not a COM interface or a POD object). If you now have such code, after updating the compiler you should make sure that everything works as it should. More details can be found here: Portability At ABI Boundaries (Modern C ++) .

The following article describes the changes in the Visual C ++ compiler (which comes with Visual Studio 2015 Preview). In the article, the words “new behavior” and “now” refer specifically to this version, and “old behavior” and “earlier” refer to Visual Studio 2013 (and earlier versions).

Summary:
- Changes in the compiler
- Changes in C Runtime Library (CRT)
- STL changes
- Changes in MFC and ATL
')

Compiler Changes




Changes in the C Runtime Library (CRT)


General changes



  <locale.h> 



  <math.h> 


Source: https://habr.com/ru/post/257509/


All Articles