C-Dialect-Options.html 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2017 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Funding Free Software", the Front-Cover
  8. Texts being (a) (see below), and with the Back-Cover Texts being (b)
  9. (see below). A copy of the license is included in the section entitled
  10. "GNU Free Documentation License".
  11. (a) The FSF's Front-Cover Text is:
  12. A GNU Manual
  13. (b) The FSF's Back-Cover Text is:
  14. You have freedom to copy and modify this GNU Manual, like GNU
  15. software. Copies published by the Free Software Foundation raise
  16. funds for GNU development. -->
  17. <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
  18. <head>
  19. <title>Using the GNU Compiler Collection (GCC): C Dialect Options</title>
  20. <meta name="description" content="Using the GNU Compiler Collection (GCC): C Dialect Options">
  21. <meta name="keywords" content="Using the GNU Compiler Collection (GCC): C Dialect Options">
  22. <meta name="resource-type" content="document">
  23. <meta name="distribution" content="global">
  24. <meta name="Generator" content="makeinfo">
  25. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  26. <link href="index.html#Top" rel="start" title="Top">
  27. <link href="Option-Index.html#Option-Index" rel="index" title="Option Index">
  28. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  29. <link href="Invoking-GCC.html#Invoking-GCC" rel="up" title="Invoking GCC">
  30. <link href="C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options" rel="next" title="C++ Dialect Options">
  31. <link href="Invoking-G_002b_002b.html#Invoking-G_002b_002b" rel="prev" title="Invoking G++">
  32. <style type="text/css">
  33. <!--
  34. a.summary-letter {text-decoration: none}
  35. blockquote.smallquotation {font-size: smaller}
  36. div.display {margin-left: 3.2em}
  37. div.example {margin-left: 3.2em}
  38. div.indentedblock {margin-left: 3.2em}
  39. div.lisp {margin-left: 3.2em}
  40. div.smalldisplay {margin-left: 3.2em}
  41. div.smallexample {margin-left: 3.2em}
  42. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  43. div.smalllisp {margin-left: 3.2em}
  44. kbd {font-style:oblique}
  45. pre.display {font-family: inherit}
  46. pre.format {font-family: inherit}
  47. pre.menu-comment {font-family: serif}
  48. pre.menu-preformatted {font-family: serif}
  49. pre.smalldisplay {font-family: inherit; font-size: smaller}
  50. pre.smallexample {font-size: smaller}
  51. pre.smallformat {font-family: inherit; font-size: smaller}
  52. pre.smalllisp {font-size: smaller}
  53. span.nocodebreak {white-space:nowrap}
  54. span.nolinebreak {white-space:nowrap}
  55. span.roman {font-family:serif; font-weight:normal}
  56. span.sansserif {font-family:sans-serif; font-weight:normal}
  57. ul.no-bullet {list-style: none}
  58. -->
  59. </style>
  60. </head>
  61. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  62. <a name="C-Dialect-Options"></a>
  63. <div class="header">
  64. <p>
  65. Next: <a href="C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options" accesskey="n" rel="next">C++ Dialect Options</a>, Previous: <a href="Invoking-G_002b_002b.html#Invoking-G_002b_002b" accesskey="p" rel="prev">Invoking G++</a>, Up: <a href="Invoking-GCC.html#Invoking-GCC" accesskey="u" rel="up">Invoking GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  66. </div>
  67. <hr>
  68. <a name="Options-Controlling-C-Dialect"></a>
  69. <h3 class="section">3.4 Options Controlling C Dialect</h3>
  70. <a name="index-dialect-options"></a>
  71. <a name="index-language-dialect-options"></a>
  72. <a name="index-options_002c-dialect"></a>
  73. <p>The following options control the dialect of C (or languages derived
  74. from C, such as C++, Objective-C and Objective-C++) that the compiler
  75. accepts:
  76. </p>
  77. <dl compact="compact">
  78. <dd><a name="index-ANSI-support"></a>
  79. <a name="index-ISO-support"></a>
  80. </dd>
  81. <dt><code>-ansi</code></dt>
  82. <dd><a name="index-ansi-1"></a>
  83. <p>In C mode, this is equivalent to <samp>-std=c90</samp>. In C++ mode, it is
  84. equivalent to <samp>-std=c++98</samp>.
  85. </p>
  86. <p>This turns off certain features of GCC that are incompatible with ISO
  87. C90 (when compiling C code), or of standard C++ (when compiling C++ code),
  88. such as the <code>asm</code> and <code>typeof</code> keywords, and
  89. predefined macros such as <code>unix</code> and <code>vax</code> that identify the
  90. type of system you are using. It also enables the undesirable and
  91. rarely used ISO trigraph feature. For the C compiler,
  92. it disables recognition of C++ style &lsquo;<samp>//</samp>&rsquo; comments as well as
  93. the <code>inline</code> keyword.
  94. </p>
  95. <p>The alternate keywords <code>__asm__</code>, <code>__extension__</code>,
  96. <code>__inline__</code> and <code>__typeof__</code> continue to work despite
  97. <samp>-ansi</samp>. You would not want to use them in an ISO C program, of
  98. course, but it is useful to put them in header files that might be included
  99. in compilations done with <samp>-ansi</samp>. Alternate predefined macros
  100. such as <code>__unix__</code> and <code>__vax__</code> are also available, with or
  101. without <samp>-ansi</samp>.
  102. </p>
  103. <p>The <samp>-ansi</samp> option does not cause non-ISO programs to be
  104. rejected gratuitously. For that, <samp>-Wpedantic</samp> is required in
  105. addition to <samp>-ansi</samp>. See <a href="Warning-Options.html#Warning-Options">Warning Options</a>.
  106. </p>
  107. <p>The macro <code>__STRICT_ANSI__</code> is predefined when the <samp>-ansi</samp>
  108. option is used. Some header files may notice this macro and refrain
  109. from declaring certain functions or defining certain macros that the
  110. ISO standard doesn&rsquo;t call for; this is to avoid interfering with any
  111. programs that might use these names for other things.
  112. </p>
  113. <p>Functions that are normally built in but do not have semantics
  114. defined by ISO C (such as <code>alloca</code> and <code>ffs</code>) are not built-in
  115. functions when <samp>-ansi</samp> is used. See <a href="Other-Builtins.html#Other-Builtins">Other
  116. built-in functions provided by GCC</a>, for details of the functions
  117. affected.
  118. </p>
  119. </dd>
  120. <dt><code>-std=</code></dt>
  121. <dd><a name="index-std-1"></a>
  122. <p>Determine the language standard. See <a href="Standards.html#Standards">Language Standards
  123. Supported by GCC</a>, for details of these standard versions. This option
  124. is currently only supported when compiling C or C++.
  125. </p>
  126. <p>The compiler can accept several base standards, such as &lsquo;<samp>c90</samp>&rsquo; or
  127. &lsquo;<samp>c++98</samp>&rsquo;, and GNU dialects of those standards, such as
  128. &lsquo;<samp>gnu90</samp>&rsquo; or &lsquo;<samp>gnu++98</samp>&rsquo;. When a base standard is specified, the
  129. compiler accepts all programs following that standard plus those
  130. using GNU extensions that do not contradict it. For example,
  131. <samp>-std=c90</samp> turns off certain features of GCC that are
  132. incompatible with ISO C90, such as the <code>asm</code> and <code>typeof</code>
  133. keywords, but not other GNU extensions that do not have a meaning in
  134. ISO C90, such as omitting the middle term of a <code>?:</code>
  135. expression. On the other hand, when a GNU dialect of a standard is
  136. specified, all features supported by the compiler are enabled, even when
  137. those features change the meaning of the base standard. As a result, some
  138. strict-conforming programs may be rejected. The particular standard
  139. is used by <samp>-Wpedantic</samp> to identify which features are GNU
  140. extensions given that version of the standard. For example
  141. <samp>-std=gnu90 -Wpedantic</samp> warns about C++ style &lsquo;<samp>//</samp>&rsquo;
  142. comments, while <samp>-std=gnu99 -Wpedantic</samp> does not.
  143. </p>
  144. <p>A value for this option must be provided; possible values are
  145. </p>
  146. <dl compact="compact">
  147. <dt>&lsquo;<samp>c90</samp>&rsquo;</dt>
  148. <dt>&lsquo;<samp>c89</samp>&rsquo;</dt>
  149. <dt>&lsquo;<samp>iso9899:1990</samp>&rsquo;</dt>
  150. <dd><p>Support all ISO C90 programs (certain GNU extensions that conflict
  151. with ISO C90 are disabled). Same as <samp>-ansi</samp> for C code.
  152. </p>
  153. </dd>
  154. <dt>&lsquo;<samp>iso9899:199409</samp>&rsquo;</dt>
  155. <dd><p>ISO C90 as modified in amendment 1.
  156. </p>
  157. </dd>
  158. <dt>&lsquo;<samp>c99</samp>&rsquo;</dt>
  159. <dt>&lsquo;<samp>c9x</samp>&rsquo;</dt>
  160. <dt>&lsquo;<samp>iso9899:1999</samp>&rsquo;</dt>
  161. <dt>&lsquo;<samp>iso9899:199x</samp>&rsquo;</dt>
  162. <dd><p>ISO C99. This standard is substantially completely supported, modulo
  163. bugs and floating-point issues
  164. (mainly but not entirely relating to optional C99 features from
  165. Annexes F and G). See
  166. <a href="http://gcc.gnu.org/c99status.html">http://gcc.gnu.org/c99status.html</a><!-- /@w --> for more information. The
  167. names &lsquo;<samp>c9x</samp>&rsquo; and &lsquo;<samp>iso9899:199x</samp>&rsquo; are deprecated.
  168. </p>
  169. </dd>
  170. <dt>&lsquo;<samp>c11</samp>&rsquo;</dt>
  171. <dt>&lsquo;<samp>c1x</samp>&rsquo;</dt>
  172. <dt>&lsquo;<samp>iso9899:2011</samp>&rsquo;</dt>
  173. <dd><p>ISO C11, the 2011 revision of the ISO C standard. This standard is
  174. substantially completely supported, modulo bugs, floating-point issues
  175. (mainly but not entirely relating to optional C11 features from
  176. Annexes F and G) and the optional Annexes K (Bounds-checking
  177. interfaces) and L (Analyzability). The name &lsquo;<samp>c1x</samp>&rsquo; is deprecated.
  178. </p>
  179. </dd>
  180. <dt>&lsquo;<samp>gnu90</samp>&rsquo;</dt>
  181. <dt>&lsquo;<samp>gnu89</samp>&rsquo;</dt>
  182. <dd><p>GNU dialect of ISO C90 (including some C99 features).
  183. </p>
  184. </dd>
  185. <dt>&lsquo;<samp>gnu99</samp>&rsquo;</dt>
  186. <dt>&lsquo;<samp>gnu9x</samp>&rsquo;</dt>
  187. <dd><p>GNU dialect of ISO C99. The name &lsquo;<samp>gnu9x</samp>&rsquo; is deprecated.
  188. </p>
  189. </dd>
  190. <dt>&lsquo;<samp>gnu11</samp>&rsquo;</dt>
  191. <dt>&lsquo;<samp>gnu1x</samp>&rsquo;</dt>
  192. <dd><p>GNU dialect of ISO C11. This is the default for C code.
  193. The name &lsquo;<samp>gnu1x</samp>&rsquo; is deprecated.
  194. </p>
  195. </dd>
  196. <dt>&lsquo;<samp>c++98</samp>&rsquo;</dt>
  197. <dt>&lsquo;<samp>c++03</samp>&rsquo;</dt>
  198. <dd><p>The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
  199. additional defect reports. Same as <samp>-ansi</samp> for C++ code.
  200. </p>
  201. </dd>
  202. <dt>&lsquo;<samp>gnu++98</samp>&rsquo;</dt>
  203. <dt>&lsquo;<samp>gnu++03</samp>&rsquo;</dt>
  204. <dd><p>GNU dialect of <samp>-std=c++98</samp>.
  205. </p>
  206. </dd>
  207. <dt>&lsquo;<samp>c++11</samp>&rsquo;</dt>
  208. <dt>&lsquo;<samp>c++0x</samp>&rsquo;</dt>
  209. <dd><p>The 2011 ISO C++ standard plus amendments.
  210. The name &lsquo;<samp>c++0x</samp>&rsquo; is deprecated.
  211. </p>
  212. </dd>
  213. <dt>&lsquo;<samp>gnu++11</samp>&rsquo;</dt>
  214. <dt>&lsquo;<samp>gnu++0x</samp>&rsquo;</dt>
  215. <dd><p>GNU dialect of <samp>-std=c++11</samp>.
  216. The name &lsquo;<samp>gnu++0x</samp>&rsquo; is deprecated.
  217. </p>
  218. </dd>
  219. <dt>&lsquo;<samp>c++14</samp>&rsquo;</dt>
  220. <dt>&lsquo;<samp>c++1y</samp>&rsquo;</dt>
  221. <dd><p>The 2014 ISO C++ standard plus amendments.
  222. The name &lsquo;<samp>c++1y</samp>&rsquo; is deprecated.
  223. </p>
  224. </dd>
  225. <dt>&lsquo;<samp>gnu++14</samp>&rsquo;</dt>
  226. <dt>&lsquo;<samp>gnu++1y</samp>&rsquo;</dt>
  227. <dd><p>GNU dialect of <samp>-std=c++14</samp>.
  228. This is the default for C++ code.
  229. The name &lsquo;<samp>gnu++1y</samp>&rsquo; is deprecated.
  230. </p>
  231. </dd>
  232. <dt>&lsquo;<samp>c++1z</samp>&rsquo;</dt>
  233. <dd><p>The next revision of the ISO C++ standard, tentatively planned for
  234. 2017. Support is highly experimental, and will almost certainly
  235. change in incompatible ways in future releases.
  236. </p>
  237. </dd>
  238. <dt>&lsquo;<samp>gnu++1z</samp>&rsquo;</dt>
  239. <dd><p>GNU dialect of <samp>-std=c++1z</samp>. Support is highly experimental,
  240. and will almost certainly change in incompatible ways in future
  241. releases.
  242. </p></dd>
  243. </dl>
  244. </dd>
  245. <dt><code>-fgnu89-inline</code></dt>
  246. <dd><a name="index-fgnu89_002dinline"></a>
  247. <p>The option <samp>-fgnu89-inline</samp> tells GCC to use the traditional
  248. GNU semantics for <code>inline</code> functions when in C99 mode.
  249. See <a href="Inline.html#Inline">An Inline Function is As Fast As a Macro</a>.
  250. Using this option is roughly equivalent to adding the
  251. <code>gnu_inline</code> function attribute to all inline functions
  252. (see <a href="Function-Attributes.html#Function-Attributes">Function Attributes</a>).
  253. </p>
  254. <p>The option <samp>-fno-gnu89-inline</samp> explicitly tells GCC to use the
  255. C99 semantics for <code>inline</code> when in C99 or gnu99 mode (i.e., it
  256. specifies the default behavior).
  257. This option is not supported in <samp>-std=c90</samp> or
  258. <samp>-std=gnu90</samp> mode.
  259. </p>
  260. <p>The preprocessor macros <code>__GNUC_GNU_INLINE__</code> and
  261. <code>__GNUC_STDC_INLINE__</code> may be used to check which semantics are
  262. in effect for <code>inline</code> functions. See <a href="http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros">Common Predefined
  263. Macros</a> in <cite>The C Preprocessor</cite>.
  264. </p>
  265. </dd>
  266. <dt><code>-fpermitted-flt-eval-methods=<var>style</var></code></dt>
  267. <dd><a name="index-fpermitted_002dflt_002deval_002dmethods"></a>
  268. <a name="index-fpermitted_002dflt_002deval_002dmethods_003dc11"></a>
  269. <a name="index-fpermitted_002dflt_002deval_002dmethods_003dts_002d18661_002d3"></a>
  270. <p>ISO/IEC TS 18661-3 defines new permissible values for
  271. <code>FLT_EVAL_METHOD</code> that indicate that operations and constants with
  272. a semantic type that is an interchange or extended format should be
  273. evaluated to the precision and range of that type. These new values are
  274. a superset of those permitted under C99/C11, which does not specify the
  275. meaning of other positive values of <code>FLT_EVAL_METHOD</code>. As such, code
  276. conforming to C11 may not have been written expecting the possibility of
  277. the new values.
  278. </p>
  279. <p><samp>-fpermitted-flt-eval-methods</samp> specifies whether the compiler
  280. should allow only the values of <code>FLT_EVAL_METHOD</code> specified in C99/C11,
  281. or the extended set of values specified in ISO/IEC TS 18661-3.
  282. </p>
  283. <p><var>style</var> is either <code>c11</code> or <code>ts-18661-3</code> as appropriate.
  284. </p>
  285. <p>The default when in a standards compliant mode (<samp>-std=c11</samp> or similar)
  286. is <samp>-fpermitted-flt-eval-methods=c11</samp>. The default when in a GNU
  287. dialect (<samp>-std=gnu11</samp> or similar) is
  288. <samp>-fpermitted-flt-eval-methods=ts-18661-3</samp>.
  289. </p>
  290. </dd>
  291. <dt><code>-aux-info <var>filename</var></code></dt>
  292. <dd><a name="index-aux_002dinfo"></a>
  293. <p>Output to the given filename prototyped declarations for all functions
  294. declared and/or defined in a translation unit, including those in header
  295. files. This option is silently ignored in any language other than C.
  296. </p>
  297. <p>Besides declarations, the file indicates, in comments, the origin of
  298. each declaration (source file and line), whether the declaration was
  299. implicit, prototyped or unprototyped (&lsquo;<samp>I</samp>&rsquo;, &lsquo;<samp>N</samp>&rsquo; for new or
  300. &lsquo;<samp>O</samp>&rsquo; for old, respectively, in the first character after the line
  301. number and the colon), and whether it came from a declaration or a
  302. definition (&lsquo;<samp>C</samp>&rsquo; or &lsquo;<samp>F</samp>&rsquo;, respectively, in the following
  303. character). In the case of function definitions, a K&amp;R-style list of
  304. arguments followed by their declarations is also provided, inside
  305. comments, after the declaration.
  306. </p>
  307. </dd>
  308. <dt><code>-fallow-parameterless-variadic-functions</code></dt>
  309. <dd><a name="index-fallow_002dparameterless_002dvariadic_002dfunctions"></a>
  310. <p>Accept variadic functions without named parameters.
  311. </p>
  312. <p>Although it is possible to define such a function, this is not very
  313. useful as it is not possible to read the arguments. This is only
  314. supported for C as this construct is allowed by C++.
  315. </p>
  316. </dd>
  317. <dt><code>-fno-asm</code></dt>
  318. <dd><a name="index-fno_002dasm"></a>
  319. <p>Do not recognize <code>asm</code>, <code>inline</code> or <code>typeof</code> as a
  320. keyword, so that code can use these words as identifiers. You can use
  321. the keywords <code>__asm__</code>, <code>__inline__</code> and <code>__typeof__</code>
  322. instead. <samp>-ansi</samp> implies <samp>-fno-asm</samp>.
  323. </p>
  324. <p>In C++, this switch only affects the <code>typeof</code> keyword, since
  325. <code>asm</code> and <code>inline</code> are standard keywords. You may want to
  326. use the <samp>-fno-gnu-keywords</samp> flag instead, which has the same
  327. effect. In C99 mode (<samp>-std=c99</samp> or <samp>-std=gnu99</samp>), this
  328. switch only affects the <code>asm</code> and <code>typeof</code> keywords, since
  329. <code>inline</code> is a standard keyword in ISO C99.
  330. </p>
  331. </dd>
  332. <dt><code>-fno-builtin</code></dt>
  333. <dt><code>-fno-builtin-<var>function</var></code></dt>
  334. <dd><a name="index-fno_002dbuiltin"></a>
  335. <a name="index-built_002din-functions"></a>
  336. <p>Don&rsquo;t recognize built-in functions that do not begin with
  337. &lsquo;<samp>__builtin_</samp>&rsquo; as prefix. See <a href="Other-Builtins.html#Other-Builtins">Other built-in
  338. functions provided by GCC</a>, for details of the functions affected,
  339. including those which are not built-in functions when <samp>-ansi</samp> or
  340. <samp>-std</samp> options for strict ISO C conformance are used because they
  341. do not have an ISO standard meaning.
  342. </p>
  343. <p>GCC normally generates special code to handle certain built-in functions
  344. more efficiently; for instance, calls to <code>alloca</code> may become single
  345. instructions which adjust the stack directly, and calls to <code>memcpy</code>
  346. may become inline copy loops. The resulting code is often both smaller
  347. and faster, but since the function calls no longer appear as such, you
  348. cannot set a breakpoint on those calls, nor can you change the behavior
  349. of the functions by linking with a different library. In addition,
  350. when a function is recognized as a built-in function, GCC may use
  351. information about that function to warn about problems with calls to
  352. that function, or to generate more efficient code, even if the
  353. resulting code still contains calls to that function. For example,
  354. warnings are given with <samp>-Wformat</samp> for bad calls to
  355. <code>printf</code> when <code>printf</code> is built in and <code>strlen</code> is
  356. known not to modify global memory.
  357. </p>
  358. <p>With the <samp>-fno-builtin-<var>function</var></samp> option
  359. only the built-in function <var>function</var> is
  360. disabled. <var>function</var> must not begin with &lsquo;<samp>__builtin_</samp>&rsquo;. If a
  361. function is named that is not built-in in this version of GCC, this
  362. option is ignored. There is no corresponding
  363. <samp>-fbuiltin-<var>function</var></samp> option; if you wish to enable
  364. built-in functions selectively when using <samp>-fno-builtin</samp> or
  365. <samp>-ffreestanding</samp>, you may define macros such as:
  366. </p>
  367. <div class="smallexample">
  368. <pre class="smallexample">#define abs(n) __builtin_abs ((n))
  369. #define strcpy(d, s) __builtin_strcpy ((d), (s))
  370. </pre></div>
  371. </dd>
  372. <dt><code>-fgimple</code></dt>
  373. <dd><a name="index-fgimple"></a>
  374. <p>Enable parsing of function definitions marked with <code>__GIMPLE</code>.
  375. This is an experimental feature that allows unit testing of GIMPLE
  376. passes.
  377. </p>
  378. </dd>
  379. <dt><code>-fhosted</code></dt>
  380. <dd><a name="index-fhosted"></a>
  381. <a name="index-hosted-environment-1"></a>
  382. <p>Assert that compilation targets a hosted environment. This implies
  383. <samp>-fbuiltin</samp>. A hosted environment is one in which the
  384. entire standard library is available, and in which <code>main</code> has a return
  385. type of <code>int</code>. Examples are nearly everything except a kernel.
  386. This is equivalent to <samp>-fno-freestanding</samp>.
  387. </p>
  388. </dd>
  389. <dt><code>-ffreestanding</code></dt>
  390. <dd><a name="index-ffreestanding-1"></a>
  391. <a name="index-hosted-environment-2"></a>
  392. <p>Assert that compilation targets a freestanding environment. This
  393. implies <samp>-fno-builtin</samp>. A freestanding environment
  394. is one in which the standard library may not exist, and program startup may
  395. not necessarily be at <code>main</code>. The most obvious example is an OS kernel.
  396. This is equivalent to <samp>-fno-hosted</samp>.
  397. </p>
  398. <p>See <a href="Standards.html#Standards">Language Standards Supported by GCC</a>, for details of
  399. freestanding and hosted environments.
  400. </p>
  401. </dd>
  402. <dt><code>-fopenacc</code></dt>
  403. <dd><a name="index-fopenacc"></a>
  404. <a name="index-OpenACC-accelerator-programming"></a>
  405. <p>Enable handling of OpenACC directives <code>#pragma acc</code> in C/C++ and
  406. <code>!$acc</code> in Fortran. When <samp>-fopenacc</samp> is specified, the
  407. compiler generates accelerated code according to the OpenACC Application
  408. Programming Interface v2.0 <a href="http://www.openacc.org/">http://www.openacc.org/</a><!-- /@w -->. This option
  409. implies <samp>-pthread</samp>, and thus is only supported on targets that
  410. have support for <samp>-pthread</samp>.
  411. </p>
  412. </dd>
  413. <dt><code>-fopenacc-dim=<var>geom</var></code></dt>
  414. <dd><a name="index-fopenacc_002ddim"></a>
  415. <a name="index-OpenACC-accelerator-programming-1"></a>
  416. <p>Specify default compute dimensions for parallel offload regions that do
  417. not explicitly specify. The <var>geom</var> value is a triple of
  418. &rsquo;:&rsquo;-separated sizes, in order &rsquo;gang&rsquo;, &rsquo;worker&rsquo; and, &rsquo;vector&rsquo;. A size
  419. can be omitted, to use a target-specific default value.
  420. </p>
  421. </dd>
  422. <dt><code>-fopenmp</code></dt>
  423. <dd><a name="index-fopenmp"></a>
  424. <a name="index-OpenMP-parallel"></a>
  425. <p>Enable handling of OpenMP directives <code>#pragma omp</code> in C/C++ and
  426. <code>!$omp</code> in Fortran. When <samp>-fopenmp</samp> is specified, the
  427. compiler generates parallel code according to the OpenMP Application
  428. Program Interface v4.5 <a href="http://www.openmp.org/">http://www.openmp.org/</a><!-- /@w -->. This option
  429. implies <samp>-pthread</samp>, and thus is only supported on targets that
  430. have support for <samp>-pthread</samp>. <samp>-fopenmp</samp> implies
  431. <samp>-fopenmp-simd</samp>.
  432. </p>
  433. </dd>
  434. <dt><code>-fopenmp-simd</code></dt>
  435. <dd><a name="index-fopenmp_002dsimd"></a>
  436. <a name="index-OpenMP-SIMD"></a>
  437. <a name="index-SIMD"></a>
  438. <p>Enable handling of OpenMP&rsquo;s SIMD directives with <code>#pragma omp</code>
  439. in C/C++ and <code>!$omp</code> in Fortran. Other OpenMP directives
  440. are ignored.
  441. </p>
  442. </dd>
  443. <dt><code>-fcilkplus</code></dt>
  444. <dd><a name="index-fcilkplus"></a>
  445. <a name="index-Enable-Cilk-Plus"></a>
  446. <p>Enable the usage of Cilk Plus language extension features for C/C++.
  447. When the option <samp>-fcilkplus</samp> is specified, enable the usage of
  448. the Cilk Plus Language extension features for C/C++. The present
  449. implementation follows ABI version 1.2. This is an experimental
  450. feature that is only partially complete, and whose interface may
  451. change in future versions of GCC as the official specification
  452. changes. Currently, all features but <code>_Cilk_for</code> have been
  453. implemented.
  454. </p>
  455. </dd>
  456. <dt><code>-fgnu-tm</code></dt>
  457. <dd><a name="index-fgnu_002dtm"></a>
  458. <p>When the option <samp>-fgnu-tm</samp> is specified, the compiler
  459. generates code for the Linux variant of Intel&rsquo;s current Transactional
  460. Memory ABI specification document (Revision 1.1, May 6 2009). This is
  461. an experimental feature whose interface may change in future versions
  462. of GCC, as the official specification changes. Please note that not
  463. all architectures are supported for this feature.
  464. </p>
  465. <p>For more information on GCC&rsquo;s support for transactional memory,
  466. See <a href="../libitm/Enabling-libitm.html#Enabling-libitm">The GNU Transactional Memory Library</a> in <cite>GNU
  467. Transactional Memory Library</cite>.
  468. </p>
  469. <p>Note that the transactional memory feature is not supported with
  470. non-call exceptions (<samp>-fnon-call-exceptions</samp>).
  471. </p>
  472. </dd>
  473. <dt><code>-fms-extensions</code></dt>
  474. <dd><a name="index-fms_002dextensions"></a>
  475. <p>Accept some non-standard constructs used in Microsoft header files.
  476. </p>
  477. <p>In C++ code, this allows member names in structures to be similar
  478. to previous types declarations.
  479. </p>
  480. <div class="smallexample">
  481. <pre class="smallexample">typedef int UOW;
  482. struct ABC {
  483. UOW UOW;
  484. };
  485. </pre></div>
  486. <p>Some cases of unnamed fields in structures and unions are only
  487. accepted with this option. See <a href="Unnamed-Fields.html#Unnamed-Fields">Unnamed struct/union
  488. fields within structs/unions</a>, for details.
  489. </p>
  490. <p>Note that this option is off for all targets but x86
  491. targets using ms-abi.
  492. </p>
  493. </dd>
  494. <dt><code>-fplan9-extensions</code></dt>
  495. <dd><a name="index-fplan9_002dextensions"></a>
  496. <p>Accept some non-standard constructs used in Plan 9 code.
  497. </p>
  498. <p>This enables <samp>-fms-extensions</samp>, permits passing pointers to
  499. structures with anonymous fields to functions that expect pointers to
  500. elements of the type of the field, and permits referring to anonymous
  501. fields declared using a typedef. See <a href="Unnamed-Fields.html#Unnamed-Fields">Unnamed
  502. struct/union fields within structs/unions</a>, for details. This is only
  503. supported for C, not C++.
  504. </p>
  505. </dd>
  506. <dt><code>-fcond-mismatch</code></dt>
  507. <dd><a name="index-fcond_002dmismatch"></a>
  508. <p>Allow conditional expressions with mismatched types in the second and
  509. third arguments. The value of such an expression is void. This option
  510. is not supported for C++.
  511. </p>
  512. </dd>
  513. <dt><code>-flax-vector-conversions</code></dt>
  514. <dd><a name="index-flax_002dvector_002dconversions"></a>
  515. <p>Allow implicit conversions between vectors with differing numbers of
  516. elements and/or incompatible element types. This option should not be
  517. used for new code.
  518. </p>
  519. </dd>
  520. <dt><code>-funsigned-char</code></dt>
  521. <dd><a name="index-funsigned_002dchar"></a>
  522. <p>Let the type <code>char</code> be unsigned, like <code>unsigned char</code>.
  523. </p>
  524. <p>Each kind of machine has a default for what <code>char</code> should
  525. be. It is either like <code>unsigned char</code> by default or like
  526. <code>signed char</code> by default.
  527. </p>
  528. <p>Ideally, a portable program should always use <code>signed char</code> or
  529. <code>unsigned char</code> when it depends on the signedness of an object.
  530. But many programs have been written to use plain <code>char</code> and
  531. expect it to be signed, or expect it to be unsigned, depending on the
  532. machines they were written for. This option, and its inverse, let you
  533. make such a program work with the opposite default.
  534. </p>
  535. <p>The type <code>char</code> is always a distinct type from each of
  536. <code>signed char</code> or <code>unsigned char</code>, even though its behavior
  537. is always just like one of those two.
  538. </p>
  539. </dd>
  540. <dt><code>-fsigned-char</code></dt>
  541. <dd><a name="index-fsigned_002dchar"></a>
  542. <p>Let the type <code>char</code> be signed, like <code>signed char</code>.
  543. </p>
  544. <p>Note that this is equivalent to <samp>-fno-unsigned-char</samp>, which is
  545. the negative form of <samp>-funsigned-char</samp>. Likewise, the option
  546. <samp>-fno-signed-char</samp> is equivalent to <samp>-funsigned-char</samp>.
  547. </p>
  548. </dd>
  549. <dt><code>-fsigned-bitfields</code></dt>
  550. <dt><code>-funsigned-bitfields</code></dt>
  551. <dt><code>-fno-signed-bitfields</code></dt>
  552. <dt><code>-fno-unsigned-bitfields</code></dt>
  553. <dd><a name="index-fsigned_002dbitfields"></a>
  554. <a name="index-funsigned_002dbitfields"></a>
  555. <a name="index-fno_002dsigned_002dbitfields"></a>
  556. <a name="index-fno_002dunsigned_002dbitfields"></a>
  557. <p>These options control whether a bit-field is signed or unsigned, when the
  558. declaration does not use either <code>signed</code> or <code>unsigned</code>. By
  559. default, such a bit-field is signed, because this is consistent: the
  560. basic integer types such as <code>int</code> are signed types.
  561. </p>
  562. </dd>
  563. <dt><code>-fsso-struct=<var>endianness</var></code></dt>
  564. <dd><a name="index-fsso_002dstruct"></a>
  565. <p>Set the default scalar storage order of structures and unions to the
  566. specified endianness. The accepted values are &lsquo;<samp>big-endian</samp>&rsquo;,
  567. &lsquo;<samp>little-endian</samp>&rsquo; and &lsquo;<samp>native</samp>&rsquo; for the native endianness of
  568. the target (the default). This option is not supported for C++.
  569. </p>
  570. <p><strong>Warning:</strong> the <samp>-fsso-struct</samp> switch causes GCC to generate
  571. code that is not binary compatible with code generated without it if the
  572. specified endianness is not the native endianness of the target.
  573. </p></dd>
  574. </dl>
  575. <hr>
  576. <div class="header">
  577. <p>
  578. Next: <a href="C_002b_002b-Dialect-Options.html#C_002b_002b-Dialect-Options" accesskey="n" rel="next">C++ Dialect Options</a>, Previous: <a href="Invoking-G_002b_002b.html#Invoking-G_002b_002b" accesskey="p" rel="prev">Invoking G++</a>, Up: <a href="Invoking-GCC.html#Invoking-GCC" accesskey="u" rel="up">Invoking GCC</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Option-Index.html#Option-Index" title="Index" rel="index">Index</a>]</p>
  579. </div>
  580. </body>
  581. </html>