Common linuxgcc Parameters

Source: Internet
Author: User
Common Parameters of linuxgcc-Linux general technology-Linux programming and kernel information. For details, refer to the following section. Common gcc/g ++ commands
Format (Option & explanation)
A collection of common linux gcc commands:
-O FILE & specifies the output FILE name. This option is not required during compilation into the target code. If FILE is not specified, the default FILE name is a. out.
-C & compile the target file only, without Link
-Mquota & code optimization for 486.
-O0 & No optimization.
-O or-O1 & optimized generation code.
-O2 & further optimization.
-O3 is further optimized than-O2 &, including the inline function.
-W & disable all warnings. Do not use this option.
-Wall & allows you to issue all the useful warnings that gcc can provide. You can also use-W (warning) to mark the specified warning.
-Werror & converts all warnings to errors to abort the compilation process when a warning occurs.
-MM & outputs a make-compatible list
-V & displays the commands used in each step of the compilation process
-E & only runs the C pre-compiler.
-Shared & generate the shared target file. It is usually used to create a shared library.
-Static & links static libraries, that is, executing static links
-LFOO & link to the function library named libFOO
-G & contains standard debugging information in executable programs
-Ggdb & only GNU debugger can be included in the executable program so that up to two other items are information
-O & optimize compiled code
-ON & specifies that the code optimization level is N, o <= N <= 3
-Ansi & supports ANSI/iso c standard syntax. Cancels parts of GNU syntax extensions that conflict with this standard (but this option does not guarantee the generation of ANSI compatible code) this option will disable certain characteristics of gnu c, such as asm or typeof keywords.

-Pedantic & all warnings listed in ANSI/iso c are allowed
-Pedantic-errors & all errors listed in ANSI/iso c are allowed
-Traditional & supports Kernighan & Ritchie C syntax (for example, defining functions using legacy syntax). It does not matter if you do not know the meaning of this option.

-IDIRECTORY & specify the path for searching for extra header files.
-LDIRECTORY & specify the search path DIRECTORY for the additional function library.
-DFOO = BAR & define the pre-processing macro FOO in the command line, and its value is BAR
-IDIRNAME & add DIRNAME to the search directory list of the header file
-LDIRNAME & add DIRNAME to the search directory list of the library file. By default, gcc only links to the shared library.
-DMACRO & defines MACRO macros with the string "1.
-DMACRO = DEFN & define the MACRO with the string "DEFN.
-UMACRO & undefines MACRO macros.
Related Article

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.