Question

Microsoft nmake tool will output any compiler warnings during build process. This is very annoying while building large projects (like Qt). Is it possible to disable warnings display while using nmake?

Was it helpful?

Solution

Not nmake is showing you the warnings, but the compiler/tools/scripts that are used. So you have to look into your Makefile, find out which programs nmake is calling and look into their documentation about the command line options of this tools. For example, for the Microsoft C++ command line compiler cl, you can add "/w" to disable all warnings. cl /? will show you the list of available options. For other programs, other command line options may be appropriate.

If you really do not like to see any output, you can call

nmake >nul: 2>nul:

sending all output to nirwana, but I am pretty sure that is not what you want.

OTHER TIPS

For Microsoft's C/C++ compiler you can disable spesific warnings from the code using #pragma directives

#pragma warning(disable:4005)

This will disable warning 4005. When you have included the suspect code, you can re enable the warning:

#pragma warning(default:4005)

first of all, the absolute majority of warnings should be taken in consideration and "resolved".

secondly, you can use #pragma as indicated Arve

the third solution see here:

To disable all compiler warnings

  1. With a project selected in Solution Explorer, on the Project menu click Properties.
  2. Click the Compile tab.
  3. Select the Disable all warnings check box.

To disable a single compiler warning

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Compile tab.
  3. In the Default Compiler Options table, set the Notification value for the warning to None.

To treat all compiler warnings as compilation errors

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Compile tab.
  3. Select the Treat all warnings as errors check box.

To treat a single compiler warning as a compilation errors

  1. With a project selected in Solution Explorer, on the Project menu, click Properties.
  2. Click the Compile tab.
  3. In the Default Compiler Options table, set the Notification value for the warning to Error.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top