Some MSVC warnings are disabled for the application by config-win32-msvc.h
Version
ACE 6.5.1
Host machine and operating system
Window 10
Target machine and operating system (if different from host)
Windows 10
Compiler name and version (including patch level)
Microsoft (R) C/C++ Optimizing Compiler Version 19.23.28106.4 for x86
The problem effects:
Compilation of the user application.
Synopsis
The include header config-win32-msvc.h disables compiler warnings and leaves these warnings disabled. This means that the warnings are also not active for the source code of the application that uses the ACE library.
Description
The ACE include header config-win32-msvc.h and pre.h disables MSVC warnings without a #pragma pop/push construction:
#if !defined (ALL_WARNINGS) && defined(_MSC_VER) && !defined(__MINGW32__)
# pragma warning(disable: 4127) /* constant expression for TRACE/ASSERT */
# pragma warning(disable: 4134) /* message map member fxn casts */
# pragma warning(disable: 4511) /* private copy constructors are good to have */
# pragma warning(disable: 4512) /* private operator= are good to have */
# pragma warning(disable: 4514) /* unreferenced inlines are common */
# pragma warning(disable: 4710) /* private constructors are disallowed */
# pragma warning(disable: 4705) /* statement has no effect in optimized code */
# pragma warning(disable: 4791) /* loss of debugging info in retail version */
# pragma warning(disable: 4275) /* deriving exported class from non-exported */
# pragma warning(disable: 4251) /* using non-exported as public in exported */
# pragma warning(disable: 4786) /* identifier was truncated to '255' characters in the browser information */
# pragma warning(disable: 4097) /* typedef-name used as synonym for class-name */
# pragma warning(disable: 4800) /* converting int to boolean */
# if defined (__INTEL_COMPILER)
# pragma warning(disable: 1744) /* field of class type without a DLL interface used in a class with a DLL interface */
# pragma warning(disable: 1738)
# endif
#endif /* !ALL_WARNINGS && _MSV_VER && !__MINGW32__ */
Sample fix/ workaround
We fixed it in an indirect way by the fact that we have the ACE headers included in our pch.h file with #pragma warning(push) .. // include ACE headers #pragma warning(pop)
Note: adding a #pragma warning(push) to the already existing ACE pre.h and #pragma warning(pop) to the ACE post.h header may be a simple fix for the problem.