Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6163905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:54:12+00:00 2026-05-23T21:54:12+00:00

When running cl.exe , you can specify the warning level. cl /W3 cl /W4

  • 0

When running cl.exe, you can specify the warning level.

cl /W3
cl /W4        # warn even more
cl /Wall      # all warnings on

However, the highest level, /Wall, seems impractical because it triggers warnings in Windows header files, such as in windef.h (Windows SDK for VS2010). The two most frequently occurring ones seem to be C4668 and C4820. So you can switch them off:

cl /Wall /wd4668 /wd4820

Still leaves you with C4255:

C:\SDKs\Windows\v7.0A\include\windef.h(230) : warning C4255: 'FARPROC'
C:\SDKs\Windows\v7.0A\include\windef.h(231) : warning C4255: 'NEARPROC'
C:\SDKs\Windows\v7.0A\include\windef.h(232) : warning C4255: 'PROC'

So you add that as well:

cl /Wall /wd4668 /wd4820 /wd4255

But others might crop up. And I might want to keep those warnings for my own code, just not have the output cluttered by warnings which did not originate in my code.

Is there a way to make the compiler apply different settings to standard headers than to my own code?

Update

Hmm, there’s a similar question, and the answer is to go with /W4 instead of /Wall. Maybe it’s not possible with MSVC to specify different settings for different files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:54:14+00:00Added an answer on May 23, 2026 at 9:54 pm

    Unfortunately, Visual Studio doesn’t seem to have an option to specify warning levels for all header files found in a specific search path or something similar to turn off the warnings. I myself just stick with /W4 because of the exact problem you’re describing.

    The only way I can think of to get around this is to use the following in all your files wherever the offending headers are included:

    #pragma warning( push, 4 ) // Saves the current warning level and sets it to 4
    #include <Windows.h>
    #pragma warning( pop )     // Restores the old warning level
    
    #include "MyHeader.h"      // Include other 'non-system' headers
    

    Note that I haven’t actually tried this, so it may not work at all!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I specify that Excel uses the .NET framework version 2.0 when running
We have more than 1 instances of a certain exe running from different locations.
I'm using Visual Basic 2008 for example i have running notepad.exe , can i
Possible Duplicate: Running a .exe file using Java How can i run a .exe
When running wsdl.exe on a WSDL I created, I get this error: Error: Unable
Problem: How to inject my own response stream to currently running iexplore.exe window.. Explation:
Is there an API for running Visual Studio Unit Tests programmatically? Running MSTests.exe with
I have several python.exe processes running on my Vista machine and I would like
My application is implemented as a service (running under services.exe). I am adding a
I have a simple .exe that needs to be running continuously. Unfortunately, sometimes it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.