Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress D9025 warning in Microsoft C++ build tools

I am compiling a library with Microsoft C++ compiler and build tools. My build environment sets the compile flag /GL, but for a specific library I need to turn that flag off. I can do so with /GL-, but I get a warning D9025, which simply tells me I am overriding the previous setting. I want to suppress this warning. But the command line option /wd only forks for Cxxx errors and warnings, not Dxxx warnings. How do I suppress the D9025 warning?

like image 400
Charles Hayden Avatar asked Feb 01 '13 06:02

Charles Hayden


People also ask

How do you suppress code Analysis warnings?

If you migrate a project to Visual Studio 2019, you might suddenly be faced with a large number of code analysis warnings. If you aren't ready to fix the warnings, you can suppress all of them by selecting Analyze > Build and Suppress Active Issues.

How do I turn off compiler warning?

Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.

How do I see warnings in Visual Studio?

To display the Error List, choose View > Error List, or press Ctrl+\+E.


1 Answers

You cannot suppress D9025, you have to fix that. Command-line warning D9025 means you have conflicting options on cl.exe command line. In your case you have something like this:

cl ... /GL ... /GL- ...

Compiler actually uses the option that is specified last on the command line, but that command line is very confusing.

In your .vcxproj file make sure you have set correct option for WholeProgramOptimization property. Your configuration section might look like this:

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
  ...
  <WholeProgramOptimization>false</WholeProgramOptimization>
</PropertyGroup>
like image 114
seva titov Avatar answered Dec 17 '22 14:12

seva titov