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 3392986
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:59:50+00:00 2026-05-18T03:59:50+00:00

Env: Visual Studio Warning Level is set to 4, Code in the only file

  • 0

Env: Visual Studio Warning Level is set to 4,
Code in the only file in solution:

#pragma warning( push )
#pragma warning( disable: 4503 )
#pragma warning( disable: 4702 )
#include <boost/property_tree/ptree.hpp>
#pragma warning ( pop ) //mark

#include "iostream"

int main()
{
boost::property_tree::ptree pt;
for( boost::property_tree::ptree::const_iterator it = pt.begin();
     it != pt.end();
     ++it )
    {
    std::cout << it->second.data() << '\n';
    }

return 0;
}

Problem: Warning 4503 still show up when compiling.
Something else I have tried:

  1. put the line with ‘//mark’ as last line of the app, no effect.
  2. if I use #pragma warning( disable: 4503 4702 ) without push/pop, it works, but it affects what’s been compiled afterwards for whole solution, even I put #pragma warning( default: xx ) somewhere, it doesn’t seem to set the warning back to default status.

Who knows why this is happening and what’s the best solution for suppressing warnings in visual studio. cheers.

  • 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-18T03:59:51+00:00Added an answer on May 18, 2026 at 3:59 am

    found answer from here:http://connect.microsoft.com/VisualStudio/feedback/details/442051/cannot-suppress-warning-in-template-function

    Roughly, the reason is because the warnings generated in my code while not in header file, because it’s template. If the code is generated in header files, it would work.

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

Sidebar

Related Questions

Why is the output of the dResult invalid ? Env: Visual Studio 2008 int
I wonder why I should use: puts In folder #{File.join ENV[HOME], projects} Instead of:
Greetings, Here is my SConstruct file: env = Environment() env.Append(CCFLAGS=['-g','-pg']) env.Program(target='program1', source= ['program1.c']) Also
How to Compile CUDA App is Visual Studio 2010 ? Here are my steps:
Env.: Vista SP1, SQL Server Express 2005 I'm able to connect to my localhost
Env.: VS 2008, .NET 2.0, WinForms I have a listview in Tile mode. Some
We are developing an extension (in C# .NET env.) for a GIS application, which
The following test fails: #!/usr/bin/env python def f(*args): >>> t = 1, -1 >>>
I have windows application build using Visual C++. Its being build and run on
Env: Oracle version: Release 10.2.0.1.0 Server: Windows XP Language in oracle: select userenv('language') from

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.