summaryrefslogtreecommitdiff
path: root/devdocs/gcc~13/invoking-gcc.html
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
committerCraig Jennings <c@cjennings.net>2024-04-07 13:41:34 -0500
commit754bbf7a25a8dda49b5d08ef0d0443bbf5af0e36 (patch)
treef1190704f78f04a2b0b4c977d20fe96a828377f1 /devdocs/gcc~13/invoking-gcc.html
new repository
Diffstat (limited to 'devdocs/gcc~13/invoking-gcc.html')
-rw-r--r--devdocs/gcc~13/invoking-gcc.html6
1 files changed, 6 insertions, 0 deletions
diff --git a/devdocs/gcc~13/invoking-gcc.html b/devdocs/gcc~13/invoking-gcc.html
new file mode 100644
index 00000000..c8195db6
--- /dev/null
+++ b/devdocs/gcc~13/invoking-gcc.html
@@ -0,0 +1,6 @@
+<div class="chapter-level-extent" id="Invoking-GCC"> <div class="nav-panel"> <p> Next: <a href="c-implementation" accesskey="n" rel="next">C Implementation-Defined Behavior</a>, Previous: <a href="standards" accesskey="p" rel="prev">Language Standards Supported by GCC</a>, Up: <a href="index" accesskey="u" rel="up">Introduction</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div> <h1 class="chapter" id="GCC-Command-Options"><span>3 GCC Command Options<a class="copiable-link" href="#GCC-Command-Options"> ¶</a></span></h1> <p>When you invoke GCC, it normally does preprocessing, compilation, assembly and linking. The “overall options” allow you to stop this process at an intermediate stage. For example, the <samp class="option">-c</samp> option says not to run the linker. Then the output consists of object files output by the assembler. See <a class="xref" href="overall-options">Options Controlling the Kind of Output</a>. </p> <p>Other options are passed on to one or more stages of processing. Some options control the preprocessor and others the compiler itself. Yet other options control the assembler and linker; most of these are not documented here, since you rarely need to use any of them. </p> <p>Most of the command-line options that you can use with GCC are useful for C programs; when an option is only useful with another language (usually C++), the explanation says so explicitly. If the description for a particular option does not mention a source language, you can use that option with all supported languages. </p> <p>The usual way to run GCC is to run the executable called <code class="command">gcc</code>, or <code class="command"><var class="var">machine</var>-gcc</code> when cross-compiling, or <code class="command"><var class="var">machine</var>-gcc-<var class="var">version</var></code> to run a specific version of GCC. When you compile C++ programs, you should invoke GCC as <code class="command">g++</code> instead. See <a class="xref" href="invoking-g_002b_002b">Compiling C++ Programs</a>, for information about the differences in behavior between <code class="command">gcc</code> and <code class="command">g++</code> when compiling C++ programs. </p> <p>The <code class="command">gcc</code> program accepts options and file names as operands. Many options have multi-letter names; therefore multiple single-letter options may <em class="emph">not</em> be grouped: <samp class="option">-dv</samp> is very different from ‘<samp class="samp">-d -v</samp>’. </p> <p>You can mix options and other arguments. For the most part, the order you use doesn’t matter. Order does matter when you use several options of the same kind; for example, if you specify <samp class="option">-L</samp> more than once, the directories are searched in the order specified. Also, the placement of the <samp class="option">-l</samp> option is significant. </p> <p>Many options have long names starting with ‘<samp class="samp">-f</samp>’ or with ‘<samp class="samp">-W</samp>’—for example, <samp class="option">-fmove-loop-invariants</samp>, <samp class="option">-Wformat</samp> and so on. Most of these have both positive and negative forms; the negative form of <samp class="option">-ffoo</samp> is <samp class="option">-fno-foo</samp>. This manual documents only one of these two forms, whichever one is not the default. </p> <p>Some options take one or more arguments typically separated either by a space or by the equals sign (‘<samp class="samp">=</samp>’) from the option name. Unless documented otherwise, an argument can be either numeric or a string. Numeric arguments must typically be small unsigned decimal or hexadecimal integers. Hexadecimal arguments must begin with the ‘<samp class="samp">0x</samp>’ prefix. Arguments to options that specify a size threshold of some sort may be arbitrarily large decimal or hexadecimal integers followed by a byte size suffix designating a multiple of bytes such as <code class="code">kB</code> and <code class="code">KiB</code> for kilobyte and kibibyte, respectively, <code class="code">MB</code> and <code class="code">MiB</code> for megabyte and mebibyte, <code class="code">GB</code> and <code class="code">GiB</code> for gigabyte and gigibyte, and so on. Such arguments are designated by <var class="var">byte-size</var> in the following text. Refer to the NIST, IEC, and other relevant national and international standards for the full listing and explanation of the binary and decimal byte size prefixes. </p> <p>See <a class="xref" href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Option-Index.html">Option Index</a>, for an index to GCC’s options. </p> <ul class="mini-toc"> <li><a href="option-summary" accesskey="1">Option Summary</a></li> <li><a href="overall-options" accesskey="2">Options Controlling the Kind of Output</a></li> <li><a href="invoking-g_002b_002b" accesskey="3">Compiling C++ Programs</a></li> <li><a href="c-dialect-options" accesskey="4">Options Controlling C Dialect</a></li> <li><a href="c_002b_002b-dialect-options" accesskey="5">Options Controlling C++ Dialect</a></li> <li><a href="objective-c-and-objective-c_002b_002b-dialect-options" accesskey="6">Options Controlling Objective-C and Objective-C++ Dialects</a></li> <li><a href="diagnostic-message-formatting-options" accesskey="7">Options to Control Diagnostic Messages Formatting</a></li> <li><a href="warning-options" accesskey="8">Options to Request or Suppress Warnings</a></li> <li><a href="static-analyzer-options" accesskey="9">Options That Control Static Analysis</a></li> <li><a href="debugging-options">Options for Debugging Your Program</a></li> <li><a href="optimize-options">Options That Control Optimization</a></li> <li><a href="instrumentation-options">Program Instrumentation Options</a></li> <li><a href="preprocessor-options">Options Controlling the Preprocessor</a></li> <li><a href="assembler-options">Passing Options to the Assembler</a></li> <li><a href="link-options">Options for Linking</a></li> <li><a href="directory-options">Options for Directory Search</a></li> <li><a href="code-gen-options">Options for Code Generation Conventions</a></li> <li><a href="developer-options">GCC Developer Options</a></li> <li><a href="submodel-options">Machine-Dependent Options</a></li> <li><a href="spec-files">Specifying Subprocesses and the Switches to Pass to Them</a></li> <li><a href="environment-variables">Environment Variables Affecting GCC</a></li> <li><a href="precompiled-headers">Using Precompiled Headers</a></li> <li><a href="c_002b_002b-modules">C++ Modules</a></li> </ul> </div> <div class="nav-panel"> <p> Next: <a href="c-implementation">C Implementation-Defined Behavior</a>, Previous: <a href="standards">Language Standards Supported by GCC</a>, Up: <a href="index">Introduction</a> [<a href="index#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="indices" title="Index" rel="index">Index</a>]</p> </div><div class="_attribution">
+ <p class="_attribution-p">
+ &copy; Free Software Foundation<br>Licensed under the GNU Free Documentation License, Version 1.3.<br>
+ <a href="https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Invoking-GCC.html" class="_attribution-link">https://gcc.gnu.org/onlinedocs/gcc-13.1.0/gcc/Invoking-GCC.html</a>
+ </p>
+</div>