parsley72
parsley72

Reputation: 9087

Can't disable compiler warning in VS2015

I have an app that uses Qt5.5.1 that builds fine in Visual Studio 2013. I'm trying to get it to work with the Qt5.6 Beta in Visual Studio 2015 but I'm getting new compiler warnings:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vcruntime_typeinfo.h(41): error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\vcruntime_typeinfo.h(41): warning C4623: '__std_type_info_data': default constructor was implicitly defined as deleted

I'm using Warning Level 4 (/W4) and Treat Warnings As Errors (/WX). But when go to the property pages and use C/C++->Advanced->Disable Specific Warnings to disable warning 4623 I see the same problem. If I change the Warning Level to 3 (/W3) or higher the same thing happens.

Why is Visual Studio giving me a warning on its own code and why can't I disable it?

Upvotes: 3

Views: 4406

Answers (2)

Kushal Gore
Kushal Gore

Reputation: 11

use #pragma in your common header files.

For example add below lines in the header files.

// To disable warning messages 4456 and 4457.  
#pragma warning( disable : 4456 4457 ) 

See MSDN page: https://msdn.microsoft.com/en-us/library/2c8f766e.aspx

Upvotes: 1

parsley72
parsley72

Reputation: 9087

Thanks to @Drop's suggestion above, I checked what was shown in the Compiler Settings after I entered 4623 in the "Disable Specific Warnings" field. I was surprised to see /wd"4623". When I removed this then added /wd4623 in the "Additional Options" field the warning disappeared.

This seems like a bug in Visual Studio 2015 but I can't find any reference to it.

Update: The bug is still there in Visual Studio 2015 Update 3, so I've reported it to Microsoft and they can recreate it.

Upvotes: 4

Related Questions