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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:17:14+00:00 2026-05-11T05:17:14+00:00

From msdn I get this: #pragma warning disable warning-list #pragma warning restore warning-list In

  • 0

From msdn I get this:

#pragma warning disable warning-list #pragma warning restore warning-list 

In the examples, both disable and restore are used. Is it necessary to restore if I want it disabled for a whole file?

Like, if I do not restore, how far does it carry? Are the warnings disabled for everything compiled after that? Or just for the rest of that file? Or is it ignored?

  • 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. 2026-05-11T05:17:14+00:00Added an answer on May 11, 2026 at 5:17 am

    If you do not restore the disabling is active for the remainder of the file.

    Interestingly this behaviour is not defined in the language specification. (see section 9.5.8) However the 9.5.1 section on Conditional compilation symbols does indicate this ‘until end of file behaviour’

    The symbol remains defined until a #undef directive for that same symbol is processed, or until the end of the source file is reached.

    Given the ‘pre-processor’ is actually part of the lexical analysis phase of compilation it is likely that this behaviour is an effective contract for Microsoft’s and all other implementations for the foreseeable future (especially since the alternate would be hugely complex and non deterministic based on source file compilation order)

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

Sidebar

Related Questions

I have used this page from MSDN to apply a custom style to my
Why in this example from MSDN, in GetEnumerator method, PeopleEnum returns IEnumerator ? public
I've tried this example directly from MSDN: Dim Screens() As System.Windows.Forms.Screens and I can't
I have this HeaderlessTabControl, which subclasses the classic TabControl. // From http://social.msdn.microsoft.com/forums/en-US/winforms/thread/c290832f-3b84-4200-aa4a-7a5dc4b8b5bb/ // Author:
I am trying to follow this example from MSDN: http://msdn.microsoft.com/en-us/library/a1hetckb.aspx I think i'm doing
Following the guide from Microsoft, http://msdn.microsoft.com/en-us/library/ee872121(VS.85).aspx , I am able to get my program
I really want to get this out of my head. Please see below code:
I get the following error when compiling a simple C# console app from MSDN
From MSDN : This method prints the current document without requiring further user input.
I've been trying to get some routing up and running. I basically want this

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.