# Pragma warning

Source: Internet
Author: User

1. # pragma warning (Disable: 4507 34; once: 4385; error: 164)
Equivalent
// Disable warning messages 4507 and 4034.
# Pragma warning (Disable: 4507 34)

// Issue warning 4385 only once.
# Pragma warning (once: 4385)

// Report warning 4164 as an error.
# Pragma warning (error: 164)

2. the compiler automatically adds 999 to the warning number between 0 and 4000.

3. A compiland Statement supports up to 56 # pragma warning statements.

4. use the # pragma warning statement in the function body. If the warning number is greater than 4699, this statement takes effect after the function ends. that is to say, the # pragma warning statement in the function body is the same as placing it after the function is completed. for example:

1. # pragma warning (Disable: 4700)
2. Void test ()
3 .{
4. Int X;
5. Int y = x; // No c4700 here
6. # pragma warning (default: 4700) // c4700 enabled after test ends
7 .}
8.
9. Int main ()
10 .{
11. Int X;
12. Int y = x; // c4700
13 .}

The row 6th is placed in any row of the test () function, which is the same effect as before the main () function after the braces in the second half of the test () function: Only for main () int y = x; in the function.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.