GCC warning options

Source: Internet
Author: User
GCC warning option-general Linux technology-Linux programming and kernel information. The following is a detailed description. Option description

-If the annotation nesting occurs in Wcomment (the second/* occurs after the first/*), a warning is issued.

-Wformat: If the parameter passed to printf and its related functions and the type specified in the corresponding format string are not properly matched, a warning is issued.

-Wmain: If the return type of main is not int or the number of parameters used when calling main is incorrect, no warning is given.

-Wparentheses if brackets are used in the place where a value is assigned (for example, (n = 10), and it is inferred to be a comparison (for example, (n = 100), or if brackets can solve the computing priority problem, issue a warning.
-Wswitch: If the swtich statement lacks the case branch of one or more of its enumerated values (applicable only when the index value is of the enum type), a warning is issued.

-Wunused: If the declared variable is not used, or the function is declared as static but never used, a warning is issued.

-Wuninitialized: If the automatic variables used are not initialized, a warning is issued.

-Wundef: if the # if macro uses undefined variables for determination, a warning is issued.

-Winline: If the function cannot be inline, a warning is issued.

-Wmissing-declarations: if a global function is defined but not declared in any header file, a warning is issued.

-Wlong-long: if the long type is used, a warning is issued.

-Werror converts all warnings to errors

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.