]>
Commit | Line | Data |
---|---|---|
069cfbff | 1 | .\" Copyright (c) 1991, 1992, 1993, 1994, 2000 Free Software Foundation -*-Text-*- |
861bb6c1 JL |
2 | .\" See section COPYING for conditions for redistribution |
3 | .\" | |
4 | .\" Set up \*(lq, \*(rq if -man hasn't already set it up. | |
5 | .if @@\*(lq@ \{\ | |
6 | . ds lq " | |
7 | . if t .ds lq `` | |
8 | . if !@@\(lq@ .ds lq "\(lq | |
9 | .\} | |
10 | .if @@\*(rq@ \{\ | |
11 | . ds rq " | |
12 | . if t .ds rq '' | |
13 | . if !@@\(rq@ .ds rq "\(rq | |
14 | .\} | |
15 | .de Id | |
16 | .ds Rv \\$3 | |
17 | .ds Dt \\$4 | |
18 | .. | |
19 | .de Sp | |
20 | .if n .sp | |
21 | .if t .sp 0.4 | |
22 | .. | |
069cfbff | 23 | .Id $Id: gcc.1,v 1.13 1999/11/02 10:23:46 law Exp $ |
861bb6c1 JL |
24 | .TH GCC 1 "\*(Dt" "GNU Tools" "GNU Tools" |
25 | .SH NAME | |
079bd08e | 26 | gcc, g++ \- GNU project C and C++ Compiler (gcc-2.96) |
861bb6c1 JL |
27 | .SH SYNOPSIS |
28 | .B gcc | |
29 | .RI "[ " option " | " filename " ].\|.\|." | |
30 | .br | |
31 | .B g++ | |
32 | .RI "[ " option " | " filename " ].\|.\|." | |
33 | .SH WARNING | |
34 | The information in this man page is an extract from the full | |
35 | documentation of the GNU C compiler, and is limited to the meaning of | |
36 | the options. | |
37 | .PP | |
38 | This man page is not kept up to date except when volunteers want to | |
39 | maintain it. If you find a discrepancy between the man page and the | |
40 | software, please check the Info file, which is the authoritative | |
41 | documentation. | |
42 | .PP | |
43 | If we find that the things in this man page that are out of date cause | |
44 | significant confusion or complaints, we will stop distributing the man | |
45 | page. The alternative, updating the man page when we update the Info | |
46 | file, is impossible because the rest of the work of maintaining GNU CC | |
47 | leaves us no time for that. The GNU project regards man pages as | |
48 | obsolete and should not let them take time away from other things. | |
49 | .PP | |
50 | For complete and current documentation, refer to the Info file `\|\c | |
51 | .B gcc\c | |
52 | \&\|' or the manual | |
53 | .I | |
54 | Using and Porting GNU CC (for version 2.0)\c | |
55 | \&. Both are made from the Texinfo source file | |
56 | .BR gcc.texinfo . | |
57 | .SH DESCRIPTION | |
58 | The C and C++ compilers are integrated. Both process input files | |
59 | through one or more of four stages: preprocessing, compilation, | |
60 | assembly, and linking. Source filename suffixes identify the source | |
61 | language, but which name you use for the compiler governs default | |
62 | assumptions: | |
63 | .TP | |
64 | .B gcc | |
65 | assumes preprocessed (\c | |
66 | .B .i\c | |
67 | \&) files are C and assumes C style linking. | |
68 | .TP | |
69 | .B g++ | |
70 | assumes preprocessed (\c | |
71 | .B .i\c | |
72 | \&) files are C++ and assumes C++ style linking. | |
73 | .PP | |
74 | Suffixes of source file names indicate the language and kind of | |
75 | processing to be done: | |
76 | .Sp | |
77 | .nf | |
78 | .ta \w'\fB.cxx\fP 'u | |
79 | \&\fB.c\fP C source; preprocess, compile, assemble | |
80 | \&\fB.C\fP C++ source; preprocess, compile, assemble | |
81 | \&\fB.cc\fP C++ source; preprocess, compile, assemble | |
82 | \&\fB.cxx\fP C++ source; preprocess, compile, assemble | |
83 | \&\fB.m\fP Objective-C source; preprocess, compile, assemble | |
84 | \&\fB.i\fP preprocessed C; compile, assemble | |
85 | \&\fB.ii\fP preprocessed C++; compile, assemble | |
86 | \&\fB.s\fP Assembler source; assemble | |
87 | \&\fB.S\fP Assembler source; preprocess, assemble | |
88 | \&\fB.h\fP Preprocessor file; not usually named on command line | |
89 | .Sp | |
90 | .fi | |
91 | Files with other suffixes are passed to the linker. Common cases include: | |
92 | .Sp | |
93 | .nf | |
94 | \&\fB.o\fP Object file | |
95 | \&\fB.a\fP Archive file | |
96 | .br | |
97 | .fi | |
98 | .Sp | |
99 | Linking is always the last stage unless you use one of the | |
100 | .BR \-c , | |
101 | .BR \-S , | |
102 | or | |
103 | .B \-E | |
104 | options to avoid it (or unless compilation errors stop the whole | |
105 | process). For the link stage, all | |
106 | .B .o | |
107 | files corresponding to source files, | |
108 | .B \-l | |
109 | libraries, unrecognized filenames (including named | |
110 | .B .o | |
111 | object files and | |
112 | .B .a | |
113 | archives) | |
114 | are passed to the linker in command-line order. | |
115 | .SH OPTIONS | |
116 | Options must be separate: `\|\c | |
117 | .B \-dr\c | |
118 | \&\|' is quite different from `\|\c | |
119 | .B \-d \-r | |
120 | \&\|'. | |
121 | .PP | |
122 | Most `\|\c | |
123 | .B \-f\c | |
124 | \&\|' and `\|\c | |
125 | .B \-W\c | |
126 | \&\|' options have two contrary forms: | |
127 | .BI \-f name | |
128 | and | |
129 | .BI \-fno\- name\c | |
130 | \& (or | |
131 | .BI \-W name | |
132 | and | |
133 | .BI \-Wno\- name\c | |
134 | \&). Only the non-default forms are shown here. | |
135 | .PP | |
136 | Here is a summary of all the options, grouped by type. Explanations are | |
137 | in the following sections. | |
138 | .hy 0 | |
139 | .na | |
140 | .TP | |
141 | .B Overall Options | |
142 | .br | |
143 | \-c | |
144 | \-S | |
145 | \-E | |
146 | .RI "\-o " file | |
147 | \-pipe | |
148 | \-v | |
149 | .RI "\-x " language | |
150 | .TP | |
151 | .B Language Options | |
152 | \-ansi | |
861bb6c1 JL |
153 | \-fcond\-mismatch |
154 | \-fdollars\-in\-identifiers | |
861bb6c1 JL |
155 | \-fexternal\-templates |
156 | \-fno\-asm | |
157 | \-fno\-builtin | |
158 | \-fhosted | |
159 | \-fno\-hosted | |
160 | \-ffreestanding | |
161 | \-fno\-freestanding | |
162 | \-fno\-strict\-prototype | |
163 | \-fsigned\-bitfields | |
164 | \-fsigned\-char | |
861bb6c1 JL |
165 | \-funsigned\-bitfields |
166 | \-funsigned\-char | |
167 | \-fwritable\-strings | |
168 | \-traditional | |
169 | \-traditional\-cpp | |
170 | \-trigraphs | |
171 | .TP | |
172 | .B Warning Options | |
173 | \-fsyntax\-only | |
174 | \-pedantic | |
175 | \-pedantic\-errors | |
176 | \-w | |
177 | \-W | |
178 | \-Wall | |
179 | \-Waggregate\-return | |
180 | \-Wcast\-align | |
181 | \-Wcast\-qual | |
182 | \-Wchar\-subscript | |
183 | \-Wcomment | |
184 | \-Wconversion | |
861bb6c1 JL |
185 | \-Werror |
186 | \-Wformat | |
187 | .RI \-Wid\-clash\- len | |
188 | \-Wimplicit | |
f2d76545 JL |
189 | \-Wimplicit\-int |
190 | \-Wimplicit\-function\-declaration | |
861bb6c1 | 191 | \-Winline |
795add94 | 192 | \-Wlong\-long |
861bb6c1 JL |
193 | \-Wmain |
194 | \-Wmissing\-prototypes | |
195 | \-Wmissing\-declarations | |
196 | \-Wnested\-externs | |
197 | \-Wno\-import | |
198 | \-Wparentheses | |
199 | \-Wpointer\-arith | |
200 | \-Wredundant\-decls | |
201 | \-Wreturn\-type | |
202 | \-Wshadow | |
203 | \-Wstrict\-prototypes | |
204 | \-Wswitch | |
861bb6c1 JL |
205 | \-Wtraditional |
206 | \-Wtrigraphs | |
207 | \-Wuninitialized | |
208 | \-Wunused | |
209 | \-Wwrite\-strings | |
210 | .TP | |
211 | .B Debugging Options | |
212 | \-a | |
213 | .RI \-d letters | |
214 | \-fpretend\-float | |
215 | \-g | |
216 | .RI \-g level | |
217 | \-gcoff | |
218 | \-gxcoff | |
219 | \-gxcoff+ | |
220 | \-gdwarf | |
221 | \-gdwarf+ | |
222 | \-gstabs | |
223 | \-gstabs+ | |
224 | \-ggdb | |
225 | \-p | |
226 | \-pg | |
227 | \-save\-temps | |
228 | .RI \-print\-file\-name= library | |
229 | \-print\-libgcc\-file\-name | |
230 | .RI \-print\-prog\-name= program | |
231 | .TP | |
232 | .B Optimization Options | |
233 | \-fcaller\-saves | |
234 | \-fcse\-follow\-jumps | |
235 | \-fcse\-skip\-blocks | |
236 | \-fdelayed\-branch | |
237 | \-felide\-constructors | |
238 | \-fexpensive\-optimizations | |
239 | \-ffast\-math | |
240 | \-ffloat\-store | |
241 | \-fforce\-addr | |
242 | \-fforce\-mem | |
243 | \-finline\-functions | |
244 | \-fkeep\-inline\-functions | |
245 | \-fmemoize\-lookups | |
246 | \-fno\-default\-inline | |
247 | \-fno\-defer\-pop | |
248 | \-fno\-function\-cse | |
249 | \-fno\-inline | |
250 | \-fno\-peephole | |
251 | \-fomit\-frame\-pointer | |
252 | \-frerun\-cse\-after\-loop | |
253 | \-fschedule\-insns | |
254 | \-fschedule\-insns2 | |
255 | \-fstrength\-reduce | |
256 | \-fthread\-jumps | |
257 | \-funroll\-all\-loops | |
258 | \-funroll\-loops | |
259 | \-O | |
260 | \-O2 | |
1a9a83b1 | 261 | \-O3 |
861bb6c1 JL |
262 | .TP |
263 | .B Preprocessor Options | |
264 | .RI \-A assertion | |
265 | \-C | |
266 | \-dD | |
267 | \-dM | |
268 | \-dN | |
269 | .RI \-D macro [\|= defn \|] | |
270 | \-E | |
271 | \-H | |
272 | .RI "\-idirafter " dir | |
273 | .RI "\-include " file | |
274 | .RI "\-imacros " file | |
275 | .RI "\-iprefix " file | |
276 | .RI "\-iwithprefix " dir | |
277 | \-M | |
278 | \-MD | |
279 | \-MM | |
280 | \-MMD | |
281 | \-nostdinc | |
282 | \-P | |
283 | .RI \-U macro | |
284 | \-undef | |
285 | .TP | |
286 | .B Assembler Option | |
287 | .RI \-Wa, option | |
288 | .TP | |
289 | .B Linker Options | |
290 | .RI \-l library | |
291 | \-nostartfiles | |
292 | \-nostdlib | |
293 | \-static | |
294 | \-shared | |
295 | \-symbolic | |
296 | .RI "\-Xlinker\ " option | |
297 | .RI \-Wl, option | |
298 | .RI "\-u " symbol | |
299 | .TP | |
300 | .B Directory Options | |
301 | .RI \-B prefix | |
302 | .RI \-I dir | |
303 | \-I\- | |
304 | .RI \-L dir | |
305 | .TP | |
306 | .B Target Options | |
307 | .RI "\-b " machine | |
308 | .RI "\-V " version | |
309 | .TP | |
310 | .B Configuration Dependent Options | |
311 | .I M680x0\ Options | |
312 | .br | |
313 | \-m68000 | |
314 | \-m68020 | |
315 | \-m68020\-40 | |
316 | \-m68030 | |
317 | \-m68040 | |
318 | \-m68881 | |
319 | \-mbitfield | |
320 | \-mc68000 | |
321 | \-mc68020 | |
322 | \-mfpa | |
323 | \-mnobitfield | |
324 | \-mrtd | |
325 | \-mshort | |
326 | \-msoft\-float | |
327 | .Sp | |
328 | .I VAX Options | |
329 | .br | |
330 | \-mg | |
331 | \-mgnu | |
332 | \-munix | |
333 | .Sp | |
334 | .I SPARC Options | |
335 | .br | |
336 | \-mepilogue | |
337 | \-mfpu | |
338 | \-mhard\-float | |
339 | \-mno\-fpu | |
340 | \-mno\-epilogue | |
341 | \-msoft\-float | |
342 | \-msparclite | |
343 | \-mv8 | |
344 | \-msupersparc | |
345 | \-mcypress | |
346 | .Sp | |
347 | .I Convex Options | |
348 | .br | |
349 | \-margcount | |
350 | \-mc1 | |
351 | \-mc2 | |
352 | \-mnoargcount | |
353 | .Sp | |
354 | .I AMD29K Options | |
355 | .br | |
356 | \-m29000 | |
357 | \-m29050 | |
358 | \-mbw | |
359 | \-mdw | |
360 | \-mkernel\-registers | |
361 | \-mlarge | |
362 | \-mnbw | |
363 | \-mnodw | |
364 | \-msmall | |
365 | \-mstack\-check | |
366 | \-muser\-registers | |
367 | .Sp | |
368 | .I M88K Options | |
369 | .br | |
370 | \-m88000 | |
371 | \-m88100 | |
372 | \-m88110 | |
373 | \-mbig\-pic | |
374 | \-mcheck\-zero\-division | |
375 | \-mhandle\-large\-shift | |
376 | \-midentify\-revision | |
377 | \-mno\-check\-zero\-division | |
378 | \-mno\-ocs\-debug\-info | |
379 | \-mno\-ocs\-frame\-position | |
380 | \-mno\-optimize\-arg\-area | |
381 | \-mno\-serialize\-volatile | |
382 | \-mno\-underscores | |
383 | \-mocs\-debug\-info | |
384 | \-mocs\-frame\-position | |
385 | \-moptimize\-arg\-area | |
386 | \-mserialize\-volatile | |
387 | .RI \-mshort\-data\- num | |
388 | \-msvr3 | |
389 | \-msvr4 | |
390 | \-mtrap\-large\-shift | |
391 | \-muse\-div\-instruction | |
392 | \-mversion\-03.00 | |
393 | \-mwarn\-passed\-structs | |
394 | .Sp | |
395 | .I RS6000 Options | |
396 | .br | |
397 | \-mfp\-in\-toc | |
398 | \-mno\-fop\-in\-toc | |
399 | .Sp | |
400 | .I RT Options | |
401 | .br | |
402 | \-mcall\-lib\-mul | |
403 | \-mfp\-arg\-in\-fpregs | |
404 | \-mfp\-arg\-in\-gregs | |
405 | \-mfull\-fp\-blocks | |
406 | \-mhc\-struct\-return | |
407 | \-min\-line\-mul | |
408 | \-mminimum\-fp\-blocks | |
409 | \-mnohc\-struct\-return | |
410 | .Sp | |
411 | .I MIPS Options | |
412 | .br | |
413 | \-mcpu=\fIcpu type\fP | |
414 | \-mips2 | |
415 | \-mips3 | |
416 | \-mint64 | |
417 | \-mlong64 | |
418 | \-mlonglong128 | |
419 | \-mmips\-as | |
420 | \-mgas | |
421 | \-mrnames | |
422 | \-mno\-rnames | |
423 | \-mgpopt | |
424 | \-mno\-gpopt | |
425 | \-mstats | |
426 | \-mno\-stats | |
427 | \-mmemcpy | |
428 | \-mno\-memcpy | |
429 | \-mno\-mips\-tfile | |
430 | \-mmips\-tfile | |
431 | \-msoft\-float | |
432 | \-mhard\-float | |
433 | \-mabicalls | |
434 | \-mno\-abicalls | |
435 | \-mhalf\-pic | |
436 | \-mno\-half\-pic | |
437 | \-G \fInum\fP | |
438 | \-nocpp | |
439 | .Sp | |
440 | .I i386 Options | |
441 | .br | |
442 | \-m486 | |
443 | \-mno\-486 | |
444 | \-msoft\-float | |
445 | \-mno\-fp\-ret\-in\-387 | |
446 | .Sp | |
447 | .I HPPA Options | |
448 | .br | |
449 | \-mpa\-risc\-1\-0 | |
450 | \-mpa\-risc\-1\-1 | |
451 | \-mkernel | |
861bb6c1 JL |
452 | \-mlong\-calls |
453 | \-mdisable\-fpregs | |
454 | \-mdisable\-indexing | |
455 | \-mtrailing\-colon | |
456 | .Sp | |
457 | .I i960 Options | |
458 | .br | |
459 | \-m\fIcpu-type\fP | |
460 | \-mnumerics | |
461 | \-msoft\-float | |
462 | \-mleaf\-procedures | |
463 | \-mno\-leaf\-procedures | |
464 | \-mtail\-call | |
465 | \-mno\-tail\-call | |
466 | \-mcomplex\-addr | |
467 | \-mno\-complex\-addr | |
468 | \-mcode\-align | |
469 | \-mno\-code\-align | |
470 | \-mic\-compat | |
471 | \-mic2.0\-compat | |
472 | \-mic3.0\-compat | |
473 | \-masm\-compat | |
474 | \-mintel\-asm | |
475 | \-mstrict\-align | |
476 | \-mno\-strict\-align | |
477 | \-mold\-align | |
478 | \-mno\-old\-align | |
479 | .Sp | |
480 | .I DEC Alpha Options | |
481 | .br | |
482 | \-mfp\-regs | |
483 | \-mno\-fp\-regs | |
484 | \-mno\-soft\-float | |
485 | \-msoft\-float | |
486 | .Sp | |
487 | .I System V Options | |
488 | .br | |
489 | \-G | |
490 | \-Qy | |
491 | \-Qn | |
492 | .RI \-YP, paths | |
493 | .RI \-Ym, dir | |
494 | .TP | |
495 | .B Code Generation Options | |
496 | .RI \-fcall\-saved\- reg | |
497 | .RI \-fcall\-used\- reg | |
498 | .RI \-ffixed\- reg | |
499 | \-finhibit\-size\-directive | |
500 | \-fnonnull\-objects | |
501 | \-fno\-common | |
502 | \-fno\-ident | |
503 | \-fno\-gnu\-linker | |
504 | \-fpcc\-struct\-return | |
505 | \-fpic | |
506 | \-fPIC | |
507 | \-freg\-struct\-return | |
508 | \-fshared\-data | |
509 | \-fshort\-enums | |
510 | \-fshort\-double | |
511 | \-fvolatile | |
512 | \-fvolatile\-global | |
513 | \-fverbose\-asm | |
514 | .ad b | |
515 | .hy 1 | |
516 | .SH OVERALL OPTIONS | |
517 | .TP | |
518 | .BI "\-x " "language" | |
519 | Specify explicitly the | |
520 | .I language\c | |
521 | \& for the following input files (rather than choosing a default based | |
522 | on the file name suffix) . This option applies to all following input | |
523 | files until the next `\|\c | |
524 | .B \-x\c | |
525 | \&\|' option. Possible values of \c | |
526 | .I language\c | |
527 | \& are | |
528 | `\|\c | |
529 | .B c\c | |
530 | \&\|', `\|\c | |
531 | .B objective\-c\c | |
532 | \&\|', `\|\c | |
533 | .B c\-header\c | |
534 | \&\|', `\|\c | |
535 | .B c++\c | |
536 | \&\|', | |
537 | `\|\c | |
538 | .B cpp\-output\c | |
539 | \&\|', `\|\c | |
540 | .B assembler\c | |
541 | \&\|', and `\|\c | |
542 | .B assembler\-with\-cpp\c | |
543 | \&\|'. | |
544 | .TP | |
545 | .B \-x none | |
546 | Turn off any specification of a language, so that subsequent files are | |
547 | handled according to their file name suffixes (as they are if `\|\c | |
548 | .B \-x\c | |
549 | \&\|' | |
550 | has not been used at all). | |
551 | .PP | |
552 | If you want only some of the four stages (preprocess, compile, | |
553 | assemble, link), you can use | |
554 | `\|\c | |
555 | .B \-x\c | |
556 | \&\|' (or filename suffixes) to tell \c | |
557 | .B gcc\c | |
558 | \& where to start, and | |
559 | one of the options `\|\c | |
560 | .B \-c\c | |
561 | \&\|', `\|\c | |
562 | .B \-S\c | |
563 | \&\|', or `\|\c | |
564 | .B \-E\c | |
565 | \&\|' to say where | |
566 | .B gcc\c | |
567 | \& is to stop. Note that some combinations (for example, | |
568 | `\|\c | |
569 | .B \-x cpp\-output \-E\c | |
570 | \&\|') instruct \c | |
571 | .B gcc\c | |
572 | \& to do nothing at all. | |
573 | .TP | |
574 | .B \-c | |
575 | Compile or assemble the source files, but do not link. The compiler | |
576 | output is an object file corresponding to each source file. | |
577 | .Sp | |
578 | By default, GCC makes the object file name for a source file by replacing | |
579 | the suffix `\|\c | |
580 | .B .c\c | |
581 | \&\|', `\|\c | |
582 | .B .i\c | |
583 | \&\|', `\|\c | |
584 | .B .s\c | |
585 | \&\|', etc., with `\|\c | |
586 | .B .o\c | |
587 | \&\|'. Use | |
588 | .B \-o\c | |
589 | \& to select another name. | |
590 | .Sp | |
591 | GCC ignores any unrecognized input files (those that do not require | |
592 | compilation or assembly) with the | |
593 | .B \-c | |
594 | option. | |
595 | .TP | |
596 | .B \-S | |
597 | Stop after the stage of compilation proper; do not assemble. The output | |
598 | is an assembler code file for each non-assembler input | |
599 | file specified. | |
600 | .Sp | |
601 | By default, GCC makes the assembler file name for a source file by | |
602 | replacing the suffix `\|\c | |
603 | .B .c\c | |
604 | \&\|', `\|\c | |
605 | .B .i\c | |
606 | \&\|', etc., with `\|\c | |
607 | .B .s\c | |
608 | \&\|'. Use | |
609 | .B \-o\c | |
610 | \& to select another name. | |
611 | .Sp | |
612 | GCC ignores any input files that don't require compilation. | |
613 | .TP | |
614 | .B \-E | |
615 | Stop after the preprocessing stage; do not run the compiler proper. The | |
616 | output is preprocessed source code, which is sent to the | |
617 | standard output. | |
618 | .Sp | |
619 | GCC ignores input files which don't require preprocessing. | |
620 | .TP | |
621 | .BI "\-o " file | |
622 | Place output in file \c | |
623 | .I file\c | |
624 | \&. This applies regardless to whatever | |
625 | sort of output GCC is producing, whether it be an executable file, | |
626 | an object file, an assembler file or preprocessed C code. | |
627 | .Sp | |
628 | Since only one output file can be specified, it does not make sense to | |
629 | use `\|\c | |
630 | .B \-o\c | |
631 | \&\|' when compiling more than one input file, unless you are | |
632 | producing an executable file as output. | |
633 | .Sp | |
634 | If you do not specify `\|\c | |
635 | .B \-o\c | |
636 | \&\|', the default is to put an executable file | |
637 | in `\|\c | |
638 | .B a.out\c | |
639 | \&\|', the object file for `\|\c | |
640 | .I source\c | |
641 | .B \&.\c | |
642 | .I suffix\c | |
643 | \&\c | |
644 | \&\|' in | |
645 | `\|\c | |
646 | .I source\c | |
647 | .B \&.o\c | |
648 | \&\|', its assembler file in `\|\c | |
649 | .I source\c | |
650 | .B \&.s\c | |
651 | \&\|', and | |
652 | all preprocessed C source on standard output. | |
653 | .TP | |
654 | .B \-v | |
655 | Print (on standard error output) the commands executed to run the stages | |
656 | of compilation. Also print the version number of the compiler driver | |
657 | program and of the preprocessor and the compiler proper. | |
658 | .TP | |
659 | .B \-pipe | |
660 | Use pipes rather than temporary files for communication between the | |
661 | various stages of compilation. This fails to work on some systems where | |
662 | the assembler cannot read from a pipe; but the GNU assembler has | |
663 | no trouble. | |
664 | .PP | |
665 | .SH LANGUAGE OPTIONS | |
666 | The following options control the dialect of C that the compiler | |
667 | accepts: | |
668 | .TP | |
669 | .B \-ansi | |
670 | Support all ANSI standard C programs. | |
671 | .Sp | |
672 | This turns off certain features of GNU C that are incompatible with | |
673 | ANSI C, such as the \c | |
674 | .B asm\c | |
675 | \&, \c | |
676 | .B inline\c | |
677 | \& and \c | |
678 | .B typeof | |
679 | keywords, and predefined macros such as \c | |
680 | .B unix\c | |
681 | \& and \c | |
682 | .B vax | |
683 | that identify the type of system you are using. It also enables the | |
684 | undesirable and rarely used ANSI trigraph feature, and disallows `\|\c | |
685 | .B $\c | |
686 | \&\|' as part of identifiers. | |
687 | .Sp | |
688 | The alternate keywords \c | |
689 | .B _\|_asm_\|_\c | |
690 | \&, \c | |
691 | .B _\|_extension_\|_\c | |
692 | \&, | |
693 | .B _\|_inline_\|_\c | |
694 | \& and \c | |
695 | .B _\|_typeof_\|_\c | |
696 | \& continue to work despite | |
697 | `\|\c | |
698 | .B \-ansi\c | |
699 | \&\|'. You would not want to use them in an ANSI C program, of | |
700 | course, but it is useful to put them in header files that might be included | |
701 | in compilations done with `\|\c | |
702 | .B \-ansi\c | |
703 | \&\|'. Alternate predefined macros | |
704 | such as \c | |
705 | .B _\|_unix_\|_\c | |
706 | \& and \c | |
707 | .B _\|_vax_\|_\c | |
708 | \& are also available, with or | |
709 | without `\|\c | |
710 | .B \-ansi\c | |
711 | \&\|'. | |
712 | .Sp | |
713 | The `\|\c | |
714 | .B \-ansi\c | |
715 | \&\|' option does not cause non-ANSI programs to be | |
716 | rejected gratuitously. For that, `\|\c | |
717 | .B \-pedantic\c | |
718 | \&\|' is required in | |
719 | addition to `\|\c | |
720 | .B \-ansi\c | |
721 | \&\|'. | |
722 | .Sp | |
723 | The preprocessor predefines a macro \c | |
724 | .B _\|_STRICT_ANSI_\|_\c | |
725 | \& when you use the `\|\c | |
726 | .B \-ansi\c | |
727 | \&\|' | |
728 | option. Some header files may notice this macro and refrain | |
729 | from declaring certain functions or defining certain macros that the | |
730 | ANSI standard doesn't call for; this is to avoid interfering with any | |
731 | programs that might use these names for other things. | |
732 | .TP | |
733 | .B \-fno\-asm | |
734 | Do not recognize \c | |
735 | .B asm\c | |
736 | \&, \c | |
737 | .B inline\c | |
738 | \& or \c | |
739 | .B typeof\c | |
740 | \& as a | |
741 | keyword. These words may then be used as identifiers. You can | |
742 | use \c | |
743 | .B _\|_asm_\|_\c | |
744 | \&, \c | |
745 | .B _\|_inline_\|_\c | |
746 | \& and \c | |
747 | .B _\|_typeof_\|_\c | |
748 | \& instead. | |
749 | `\|\c | |
750 | .B \-ansi\c | |
751 | \&\|' implies `\|\c | |
752 | .B \-fno\-asm\c | |
753 | \&\|'. | |
754 | .TP | |
755 | .B \-fno\-builtin | |
756 | Don't recognize built-in functions that do not begin with two leading | |
757 | underscores. Currently, the functions affected include \c | |
758 | .B _exit\c | |
759 | \&, | |
760 | .B abort\c | |
761 | \&, \c | |
762 | .B abs\c | |
763 | \&, \c | |
764 | .B alloca\c | |
765 | \&, \c | |
766 | .B cos\c | |
767 | \&, \c | |
768 | .B exit\c | |
769 | \&, | |
770 | .B fabs\c | |
771 | \&, \c | |
772 | .B labs\c | |
773 | \&, \c | |
774 | .B memcmp\c | |
775 | \&, \c | |
776 | .B memcpy\c | |
777 | \&, \c | |
778 | .B sin\c | |
779 | \&, | |
780 | .B sqrt\c | |
781 | \&, \c | |
782 | .B strcmp\c | |
783 | \&, \c | |
784 | .B strcpy\c | |
785 | \&, and \c | |
786 | .B strlen\c | |
787 | \&. | |
788 | .Sp | |
789 | The `\|\c | |
790 | .B \-ansi\c | |
791 | \&\|' option prevents \c | |
792 | .B alloca\c | |
793 | \& and \c | |
794 | .B _exit\c | |
795 | \& from | |
796 | being builtin functions. | |
797 | .TP | |
798 | .B \-fhosted | |
799 | Compile for a hosted environment; this implies the `\|\c | |
800 | .B \-fbuiltin\c | |
801 | \&\|' option, and implies that suspicious declarations of | |
802 | .B main\c | |
803 | \& should be warned about. | |
804 | .TP | |
805 | .B \-ffreestanding | |
806 | Compile for a freestanding environment; this implies the `\|\c | |
807 | .B \-fno-builtin\c | |
808 | \&\|' option, and implies that | |
809 | .B main\c | |
810 | \& has no special requirements. | |
811 | .TP | |
812 | .B \-fno\-strict\-prototype | |
813 | Treat a function declaration with no arguments, such as `\|\c | |
814 | .B int foo | |
815 | ();\c | |
816 | \&\|', as C would treat it\(em\&as saying nothing about the number of | |
817 | arguments or their types (C++ only). Normally, such a declaration in | |
818 | C++ means that the function \c | |
819 | .B foo\c | |
820 | \& takes no arguments. | |
821 | .TP | |
822 | .B \-trigraphs | |
823 | Support ANSI C trigraphs. The `\|\c | |
824 | .B \-ansi\c | |
825 | \&\|' option implies `\|\c | |
826 | .B \-trigraphs\c | |
827 | \&\|'. | |
828 | .TP | |
829 | .B \-traditional | |
830 | Attempt to support some aspects of traditional C compilers. | |
831 | For details, see the GNU C Manual; the duplicate list here | |
832 | has been deleted so that we won't get complaints when it | |
833 | is out of date. | |
861bb6c1 JL |
834 | .TP |
835 | .B \-traditional\-cpp | |
836 | Attempt to support some aspects of traditional C preprocessors. | |
837 | This includes the items that specifically mention the preprocessor above, | |
838 | but none of the other effects of `\|\c | |
839 | .B \-traditional\c | |
840 | \&\|'. | |
841 | .TP | |
842 | .B \-fdollars\-in\-identifiers | |
843 | Permit the use of `\|\c | |
844 | .B $\c | |
845 | \&\|' in identifiers (C++ only). You can also use | |
846 | `\|\c | |
847 | .B \-fno\-dollars\-in\-identifiers\c | |
848 | \&\|' to explicitly prohibit use of | |
849 | `\|\c | |
850 | .B $\c | |
851 | \&\|'. (GNU C++ allows `\|\c | |
852 | .B $\c | |
853 | \&\|' by default on some target systems | |
854 | but not others.) | |
855 | .TP | |
861bb6c1 JL |
856 | .B \-fexternal\-templates |
857 | Produce smaller code for template declarations, by generating only a | |
858 | single copy of each template function where it is defined (C++ only). | |
859 | To use this option successfully, you must also mark all files that | |
860 | use templates with either `\|\c | |
861 | .B #pragma implementation\c | |
862 | \&\|' (the definition) or | |
863 | `\|\c | |
864 | .B #pragma interface\c | |
865 | \&\|' (declarations). | |
866 | ||
867 | When your code is compiled with `\|\c | |
868 | .B \-fexternal\-templates\c | |
869 | \&\|', all | |
870 | template instantiations are external. You must arrange for all | |
871 | necessary instantiations to appear in the implementation file; you can | |
872 | do this with a \c | |
873 | .B typedef\c | |
874 | \& that references each instantiation needed. | |
875 | Conversely, when you compile using the default option | |
876 | `\|\c | |
877 | .B \-fno\-external\-templates\c | |
878 | \&\|', all template instantiations are | |
879 | explicitly internal. | |
880 | .TP | |
861bb6c1 JL |
881 | .B \-fcond\-mismatch |
882 | Allow conditional expressions with mismatched types in the second and | |
883 | third arguments. The value of such an expression is void. | |
884 | .TP | |
861bb6c1 JL |
885 | .B \-funsigned\-char |
886 | Let the type \c | |
887 | .B char\c | |
888 | \& be unsigned, like \c | |
889 | .B unsigned char\c | |
890 | \&. | |
891 | .Sp | |
892 | Each kind of machine has a default for what \c | |
893 | .B char\c | |
894 | \& should | |
895 | be. It is either like \c | |
896 | .B unsigned char\c | |
897 | \& by default or like | |
898 | .B signed char\c | |
899 | \& by default. | |
900 | .Sp | |
901 | Ideally, a portable program should always use \c | |
902 | .B signed char\c | |
903 | \& or | |
904 | .B unsigned char\c | |
905 | \& when it depends on the signedness of an object. | |
906 | But many programs have been written to use plain \c | |
907 | .B char\c | |
908 | \& and | |
909 | expect it to be signed, or expect it to be unsigned, depending on the | |
910 | machines they were written for. This option, and its inverse, let you | |
911 | make such a program work with the opposite default. | |
912 | .Sp | |
913 | The type \c | |
914 | .B char\c | |
915 | \& is always a distinct type from each of | |
916 | .B signed char\c | |
917 | \& and \c | |
918 | .B unsigned char\c | |
919 | \&, even though its behavior | |
920 | is always just like one of those two. | |
921 | .TP | |
922 | .B \-fsigned\-char | |
923 | Let the type \c | |
924 | .B char\c | |
925 | \& be signed, like \c | |
926 | .B signed char\c | |
927 | \&. | |
928 | .Sp | |
929 | Note that this is equivalent to `\|\c | |
930 | .B \-fno\-unsigned\-char\c | |
931 | \&\|', which is | |
932 | the negative form of `\|\c | |
933 | .B \-funsigned\-char\c | |
934 | \&\|'. Likewise, | |
935 | `\|\c | |
936 | .B \-fno\-signed\-char\c | |
937 | \&\|' is equivalent to `\|\c | |
938 | .B \-funsigned\-char\c | |
939 | \&\|'. | |
940 | .TP | |
941 | .B \-fsigned\-bitfields | |
942 | .TP | |
943 | .B \-funsigned\-bitfields | |
944 | .TP | |
945 | .B \-fno\-signed\-bitfields | |
946 | .TP | |
947 | .B \-fno\-unsigned\-bitfields | |
948 | These options control whether a bitfield is | |
949 | signed or unsigned, when declared with no explicit `\|\c | |
950 | .B signed\c | |
951 | \&\|' or `\|\c | |
952 | .B unsigned\c | |
953 | \&\|' qualifier. By default, such a bitfield is | |
954 | signed, because this is consistent: the basic integer types such as | |
955 | .B int\c | |
956 | \& are signed types. | |
957 | .Sp | |
958 | However, when you specify `\|\c | |
959 | .B \-traditional\c | |
960 | \&\|', bitfields are all unsigned | |
961 | no matter what. | |
962 | .TP | |
963 | .B \-fwritable\-strings | |
964 | Store string constants in the writable data segment and don't uniquize | |
965 | them. This is for compatibility with old programs which assume they | |
966 | can write into string constants. `\|\c | |
967 | .B \-traditional\c | |
968 | \&\|' also has this | |
969 | effect. | |
970 | .Sp | |
971 | Writing into string constants is a very bad idea; \*(lqconstants\*(rq should | |
972 | be constant. | |
973 | .SH PREPROCESSOR OPTIONS | |
974 | These options control the C preprocessor, which is run on each C source | |
975 | file before actual compilation. | |
976 | .PP | |
977 | If you use the `\|\c | |
978 | .B \-E\c | |
979 | \&\|' option, GCC does nothing except preprocessing. | |
980 | Some of these options make sense only together with `\|\c | |
981 | .B \-E\c | |
982 | \&\|' because | |
983 | they cause the preprocessor output to be unsuitable for actual | |
984 | compilation. | |
985 | .TP | |
986 | .BI "\-include " "file" | |
987 | Process \c | |
988 | .I file\c | |
989 | \& as input before processing the regular input file. | |
990 | In effect, the contents of \c | |
991 | .I file\c | |
992 | \& are compiled first. Any `\|\c | |
993 | .B \-D\c | |
994 | \&\|' | |
995 | and `\|\c | |
996 | .B \-U\c | |
997 | \&\|' options on the command line are always processed before | |
998 | `\|\c | |
999 | .B \-include \c | |
1000 | .I file\c | |
1001 | \&\c | |
1002 | \&\|', regardless of the order in which they are | |
1003 | written. All the `\|\c | |
1004 | .B \-include\c | |
1005 | \&\|' and `\|\c | |
1006 | .B \-imacros\c | |
1007 | \&\|' options are | |
1008 | processed in the order in which they are written. | |
1009 | .TP | |
1010 | .BI "\-imacros " file | |
1011 | Process \c | |
1012 | .I file\c | |
1013 | \& as input, discarding the resulting output, before | |
1014 | processing the regular input file. Because the output generated from | |
1015 | .I file\c | |
1016 | \& is discarded, the only effect of `\|\c | |
1017 | .B \-imacros \c | |
1018 | .I file\c | |
1019 | \&\c | |
1020 | \&\|' is to | |
1021 | make the macros defined in \c | |
1022 | .I file\c | |
1023 | \& available for use in the main | |
1024 | input. The preprocessor evaluates any `\|\c | |
1025 | .B \-D\c | |
1026 | \&\|' and `\|\c | |
1027 | .B \-U\c | |
1028 | \&\|' options | |
1029 | on the command line before processing `\|\c | |
1030 | .B \-imacros\c | |
1031 | .I file\c | |
1032 | \&\|', regardless of the order in | |
1033 | which they are written. All the `\|\c | |
1034 | .B \-include\c | |
1035 | \&\|' and `\|\c | |
1036 | .B \-imacros\c | |
1037 | \&\|' | |
1038 | options are processed in the order in which they are written. | |
1039 | .TP | |
1040 | .BI "\-idirafter " "dir" | |
1041 | Add the directory \c | |
1042 | .I dir\c | |
1043 | \& to the second include path. The directories | |
1044 | on the second include path are searched when a header file is not found | |
1045 | in any of the directories in the main include path (the one that | |
1046 | `\|\c | |
1047 | .B \-I\c | |
1048 | \&\|' adds to). | |
1049 | .TP | |
1050 | .BI "\-iprefix " "prefix" | |
1051 | Specify \c | |
1052 | .I prefix\c | |
1053 | \& as the prefix for subsequent `\|\c | |
1054 | .B \-iwithprefix\c | |
1055 | \&\|' | |
1056 | options. | |
1057 | .TP | |
1058 | .BI "\-iwithprefix " "dir" | |
1059 | Add a directory to the second include path. The directory's name is | |
1060 | made by concatenating \c | |
1061 | .I prefix\c | |
1062 | \& and \c | |
1063 | .I dir\c | |
1064 | \&, where \c | |
1065 | .I prefix | |
1066 | was specified previously with `\|\c | |
1067 | .B \-iprefix\c | |
1068 | \&\|'. | |
1069 | .TP | |
1070 | .B \-nostdinc | |
1071 | Do not search the standard system directories for header files. Only | |
1072 | the directories you have specified with `\|\c | |
1073 | .B \-I\c | |
1074 | \&\|' options (and the | |
1075 | current directory, if appropriate) are searched. | |
1076 | .Sp | |
1077 | By using both `\|\c | |
1078 | .B \-nostdinc\c | |
1079 | \&\|' and `\|\c | |
1080 | .B \-I\-\c | |
1081 | \&\|', you can limit the include-file search file to only those | |
1082 | directories you specify explicitly. | |
1083 | .TP | |
1084 | .B \-nostdinc++ | |
1085 | Do not search for header files in the C++\-specific standard directories, | |
1086 | but do still search the other standard directories. | |
1087 | (This option is used when building `\|\c | |
1088 | .B libg++\c | |
1089 | \&\|'.) | |
1090 | .TP | |
1091 | .B \-undef | |
1092 | Do not predefine any nonstandard macros. (Including architecture flags). | |
1093 | .TP | |
1094 | .B \-E | |
1095 | Run only the C preprocessor. Preprocess all the C source files | |
1096 | specified and output the results to standard output or to the | |
1097 | specified output file. | |
1098 | .TP | |
1099 | .B \-C | |
1100 | Tell the preprocessor not to discard comments. Used with the | |
1101 | `\|\c | |
1102 | .B \-E\c | |
1103 | \&\|' option. | |
1104 | .TP | |
1105 | .B \-P | |
1106 | Tell the preprocessor not to generate `\|\c | |
1107 | .B #line\c | |
1108 | \&\|' commands. | |
1109 | Used with the `\|\c | |
1110 | .B \-E\c | |
1111 | \&\|' option. | |
1112 | .TP | |
1113 | .B \-M\ [ \-MG ] | |
1114 | Tell the preprocessor to output a rule suitable for \c | |
1115 | .B make | |
1116 | describing the dependencies of each object file. For each source file, | |
1117 | the preprocessor outputs one \c | |
1118 | .B make\c | |
1119 | \&-rule whose target is the object | |
1120 | file name for that source file and whose dependencies are all the files | |
1121 | `\|\c | |
1122 | .B #include\c | |
1123 | \&\|'d in it. This rule may be a single line or may be | |
1124 | continued with `\|\c | |
1125 | .B \e\c | |
1126 | \&\|'-newline if it is long. The list of rules is | |
1127 | printed on standard output instead of the preprocessed C program. | |
1128 | .Sp | |
1129 | `\|\c | |
1130 | .B \-M\c | |
1131 | \&\|' implies `\|\c | |
1132 | .B \-E\c | |
1133 | \&\|'. | |
1134 | .Sp | |
1135 | `\|\c | |
1136 | .B \-MG\c | |
1137 | \&\|' says to treat missing header files as generated files and assume \c | |
1138 | they live in the same directory as the source file. It must be specified \c | |
1139 | in addition to `\|\c | |
1140 | .B \-M\c | |
1141 | \&\|'. | |
1142 | .TP | |
1143 | .B \-MM\ [ \-MG ] | |
1144 | Like `\|\c | |
1145 | .B \-M\c | |
1146 | \&\|' but the output mentions only the user header files | |
1147 | included with `\|\c | |
1148 | .B #include "\c | |
1149 | .I file\c | |
1150 | \&"\c | |
1151 | \&\|'. System header files | |
1152 | included with `\|\c | |
1153 | .B #include <\c | |
1154 | .I file\c | |
1155 | \&>\c | |
1156 | \&\|' are omitted. | |
1157 | .TP | |
1158 | .B \-MD | |
1159 | Like `\|\c | |
1160 | .B \-M\c | |
1161 | \&\|' but the dependency information is written to files with | |
1162 | names made by replacing `\|\c | |
1163 | .B .o\c | |
1164 | \&\|' with `\|\c | |
1165 | .B .d\c | |
1166 | \&\|' at the end of the | |
1167 | output file names. This is in addition to compiling the file as | |
1168 | specified\(em\&`\|\c | |
1169 | .B \-MD\c | |
1170 | \&\|' does not inhibit ordinary compilation the way | |
1171 | `\|\c | |
1172 | .B \-M\c | |
1173 | \&\|' does. | |
1174 | .Sp | |
1175 | The Mach utility `\|\c | |
1176 | .B md\c | |
1177 | \&\|' can be used to merge the `\|\c | |
1178 | .B .d\c | |
1179 | \&\|' files | |
1180 | into a single dependency file suitable for using with the `\|\c | |
1181 | .B make\c | |
1182 | \&\|' | |
1183 | command. | |
1184 | .TP | |
1185 | .B \-MMD | |
1186 | Like `\|\c | |
1187 | .B \-MD\c | |
1188 | \&\|' except mention only user header files, not system | |
1189 | header files. | |
1190 | .TP | |
1191 | .B \-H | |
1192 | Print the name of each header file used, in addition to other normal | |
1193 | activities. | |
1194 | .TP | |
1195 | .BI "\-A" "question" ( answer ) | |
1196 | Assert the answer | |
1197 | .I answer | |
1198 | for | |
1199 | .I question\c | |
1200 | \&, in case it is tested | |
1201 | with a preprocessor conditional such as `\|\c | |
1202 | .BI "#if #" question ( answer )\c | |
1203 | \&\|'. `\|\c | |
1204 | .B \-A\-\c | |
1205 | \&\|' disables the standard | |
1206 | assertions that normally describe the target machine. | |
1207 | .TP | |
1208 | .BI "\-A" "question"\c | |
1209 | \&(\c | |
1210 | .I answer\c | |
1211 | \&) | |
1212 | Assert the answer \c | |
1213 | .I answer\c | |
1214 | \& for \c | |
1215 | .I question\c | |
1216 | \&, in case it is tested | |
1217 | with a preprocessor conditional such as `\|\c | |
1218 | .B #if | |
1219 | #\c | |
1220 | .I question\c | |
1221 | \&(\c | |
1222 | .I answer\c | |
1223 | \&)\c | |
1224 | \&\|'. `\|\c | |
1225 | .B \-A-\c | |
1226 | \&\|' disables the standard | |
1227 | assertions that normally describe the target machine. | |
1228 | .TP | |
1229 | .BI \-D macro | |
1230 | Define macro \c | |
1231 | .I macro\c | |
1232 | \& with the string `\|\c | |
1233 | .B 1\c | |
1234 | \&\|' as its definition. | |
1235 | .TP | |
1236 | .BI \-D macro = defn | |
1237 | Define macro \c | |
1238 | .I macro\c | |
1239 | \& as \c | |
1240 | .I defn\c | |
1241 | \&. All instances of `\|\c | |
1242 | .B \-D\c | |
1243 | \&\|' on | |
1244 | the command line are processed before any `\|\c | |
1245 | .B \-U\c | |
1246 | \&\|' options. | |
1247 | .TP | |
1248 | .BI \-U macro | |
1249 | Undefine macro \c | |
1250 | .I macro\c | |
1251 | \&. `\|\c | |
1252 | .B \-U\c | |
1253 | \&\|' options are evaluated after all `\|\c | |
1254 | .B \-D\c | |
1255 | \&\|' options, but before any `\|\c | |
1256 | .B \-include\c | |
1257 | \&\|' and `\|\c | |
1258 | .B \-imacros\c | |
1259 | \&\|' options. | |
1260 | .TP | |
1261 | .B \-dM | |
1262 | Tell the preprocessor to output only a list of the macro definitions | |
1263 | that are in effect at the end of preprocessing. Used with the `\|\c | |
1264 | .B \-E\c | |
1265 | \&\|' | |
1266 | option. | |
1267 | .TP | |
1268 | .B \-dD | |
1269 | Tell the preprocessor to pass all macro definitions into the output, in | |
1270 | their proper sequence in the rest of the output. | |
1271 | .TP | |
1272 | .B \-dN | |
1273 | Like `\|\c | |
1274 | .B \-dD\c | |
1275 | \&\|' except that the macro arguments and contents are omitted. | |
1276 | Only `\|\c | |
1277 | .B #define \c | |
1278 | .I name\c | |
1279 | \&\c | |
1280 | \&\|' is included in the output. | |
1281 | .SH ASSEMBLER OPTION | |
1282 | .TP | |
1283 | .BI "\-Wa," "option" | |
1284 | Pass \c | |
1285 | .I option\c | |
1286 | \& as an option to the assembler. If \c | |
1287 | .I option | |
1288 | contains commas, it is split into multiple options at the commas. | |
1289 | .SH LINKER OPTIONS | |
1290 | These options come into play when the compiler links object files into | |
1291 | an executable output file. They are meaningless if the compiler is | |
1292 | not doing a link step. | |
1293 | .TP | |
1294 | .I object-file-name | |
1295 | A file name that does not end in a special recognized suffix is | |
1296 | considered to name an object file or library. (Object files are | |
1297 | distinguished from libraries by the linker according to the file | |
1298 | contents.) If GCC does a link step, these object files are used as input | |
1299 | to the linker. | |
1300 | .TP | |
1301 | .BI \-l library | |
1302 | Use the library named \c | |
1303 | .I library\c | |
1304 | \& when linking. | |
1305 | .Sp | |
1306 | The linker searches a standard list of directories for the library, | |
1307 | which is actually a file named `\|\c | |
1308 | .B lib\c | |
1309 | .I library\c | |
1310 | \&.a\c | |
1311 | \&\|'. The linker | |
1312 | then uses this file as if it had been specified precisely by name. | |
1313 | .Sp | |
1314 | The directories searched include several standard system directories | |
1315 | plus any that you specify with `\|\c | |
1316 | .B \-L\c | |
1317 | \&\|'. | |
1318 | .Sp | |
1319 | Normally the files found this way are library files\(em\&archive files | |
1320 | whose members are object files. The linker handles an archive file by | |
1321 | scanning through it for members which define symbols that have so far | |
1322 | been referenced but not defined. However, if the linker finds an | |
1323 | ordinary object file rather than a library, the object file is linked | |
1324 | in the usual fashion. The only difference between using an `\|\c | |
1325 | .B \-l\c | |
1326 | \&\|' option and specifying a file | |
1327 | name is that `\|\c | |
1328 | .B \-l\c | |
1329 | \&\|' surrounds | |
1330 | .I library | |
1331 | with `\|\c | |
1332 | .B lib\c | |
1333 | \&\|' and `\|\c | |
1334 | .B .a\c | |
1335 | \&\|' and searches several directories. | |
1336 | .TP | |
1337 | .B \-lobjc | |
1338 | You need this special case of the | |
1339 | .B \-l | |
1340 | option in order to link an Objective C program. | |
1341 | .TP | |
1342 | .B \-nostartfiles | |
1343 | Do not use the standard system startup files when linking. | |
1344 | The standard libraries are used normally. | |
1345 | .TP | |
1346 | .B \-nostdlib | |
1347 | Don't use the standard system libraries and startup files when linking. | |
1348 | Only the files you specify will be passed to the linker. | |
1349 | .TP | |
1350 | .B \-static | |
1351 | On systems that support dynamic linking, this prevents linking with the shared | |
1352 | libraries. On other systems, this option has no effect. | |
1353 | .TP | |
1354 | .B \-shared | |
1355 | Produce a shared object which can then be linked with other objects to | |
1356 | form an executable. Only a few systems support this option. | |
1357 | .TP | |
1358 | .B \-symbolic | |
1359 | Bind references to global symbols when building a shared object. Warn | |
1360 | about any unresolved references (unless overridden by the link editor | |
1361 | option `\|\c | |
1362 | .B | |
1363 | \-Xlinker \-z \-Xlinker defs\c | |
1364 | \&\|'). Only a few systems support | |
1365 | this option. | |
1366 | .TP | |
1367 | .BI "\-Xlinker " "option" | |
1368 | Pass \c | |
1369 | .I option | |
1370 | as an option to the linker. You can use this to | |
1371 | supply system-specific linker options which GNU CC does not know how to | |
1372 | recognize. | |
1373 | .Sp | |
1374 | If you want to pass an option that takes an argument, you must use | |
1375 | `\|\c | |
1376 | .B \-Xlinker\c | |
1377 | \&\|' twice, once for the option and once for the argument. | |
1378 | For example, to pass `\|\c | |
1379 | .B | |
1380 | \-assert definitions\c | |
1381 | \&\|', you must write | |
1382 | `\|\c | |
1383 | .B | |
1384 | \-Xlinker \-assert \-Xlinker definitions\c | |
1385 | \&\|'. It does not work to write | |
1386 | `\|\c | |
1387 | .B | |
1388 | \-Xlinker "\-assert definitions"\c | |
1389 | \&\|', because this passes the entire | |
1390 | string as a single argument, which is not what the linker expects. | |
1391 | .TP | |
1392 | .BI "\-Wl," "option" | |
1393 | Pass \c | |
1394 | .I option\c | |
1395 | \& as an option to the linker. If \c | |
1396 | .I option\c | |
1397 | \& contains | |
1398 | commas, it is split into multiple options at the commas. | |
1399 | .TP | |
1400 | .BI "\-u " "symbol" | |
1401 | Pretend the symbol | |
1402 | .I symbol | |
1403 | is undefined, to force linking of | |
1404 | library modules to define it. You can use `\|\c | |
1405 | .B \-u\c | |
1406 | \&\|' multiple times with | |
1407 | different symbols to force loading of additional library modules. | |
1408 | .SH DIRECTORY OPTIONS | |
1409 | These options specify directories to search for header files, for | |
1410 | libraries and for parts of the compiler: | |
1411 | .TP | |
1412 | .BI "\-I" "dir" | |
1413 | Append directory \c | |
1414 | .I dir\c | |
1415 | \& to the list of directories searched for include files. | |
1416 | .TP | |
1417 | .B \-I\- | |
1418 | Any directories you specify with `\|\c | |
1419 | .B \-I\c | |
1420 | \&\|' options before the `\|\c | |
1421 | .B \-I\-\c | |
1422 | \&\|' | |
1423 | option are searched only for the case of `\|\c | |
1424 | .B | |
1425 | #include "\c | |
1426 | .I file\c | |
1427 | .B | |
1428 | \&"\c | |
1429 | \&\|'; | |
1430 | they are not searched for `\|\c | |
1431 | .B #include <\c | |
1432 | .I file\c | |
1433 | \&>\c | |
1434 | \&\|'. | |
1435 | .Sp | |
1436 | If additional directories are specified with `\|\c | |
1437 | .B \-I\c | |
1438 | \&\|' options after | |
1439 | the `\|\c | |
1440 | .B \-I\-\c | |
1441 | \&\|', these directories are searched for all `\|\c | |
1442 | .B #include\c | |
1443 | \&\|' | |
1444 | directives. (Ordinarily \c | |
1445 | .I all\c | |
1446 | \& `\|\c | |
1447 | .B \-I\c | |
1448 | \&\|' directories are used | |
1449 | this way.) | |
1450 | .Sp | |
1451 | In addition, the `\|\c | |
1452 | .B \-I\-\c | |
1453 | \&\|' option inhibits the use of the current | |
1454 | directory (where the current input file came from) as the first search | |
1455 | directory for `\|\c | |
1456 | .B | |
1457 | #include "\c | |
1458 | .I file\c | |
1459 | .B | |
1460 | \&"\c | |
1461 | \&\|'. There is no way to | |
1462 | override this effect of `\|\c | |
1463 | .B \-I\-\c | |
1464 | \&\|'. With `\|\c | |
1465 | .B \-I.\c | |
1466 | \&\|' you can specify | |
1467 | searching the directory which was current when the compiler was | |
1468 | invoked. That is not exactly the same as what the preprocessor does | |
1469 | by default, but it is often satisfactory. | |
1470 | .Sp | |
1471 | `\|\c | |
1472 | .B \-I\-\c | |
1473 | \&\|' does not inhibit the use of the standard system directories | |
1474 | for header files. Thus, `\|\c | |
1475 | .B \-I\-\c | |
1476 | \&\|' and `\|\c | |
1477 | .B \-nostdinc\c | |
1478 | \&\|' are | |
1479 | independent. | |
1480 | .TP | |
1481 | .BI "\-L" "dir" | |
1482 | Add directory \c | |
1483 | .I dir\c | |
1484 | \& to the list of directories to be searched | |
1485 | for `\|\c | |
1486 | .B \-l\c | |
1487 | \&\|'. | |
1488 | .TP | |
1489 | .BI "\-B" "prefix" | |
1490 | This option specifies where to find the executables, libraries and | |
1491 | data files of the compiler itself. | |
1492 | .Sp | |
1493 | The compiler driver program runs one or more of the subprograms | |
1494 | `\|\c | |
1495 | .B cpp\c | |
1496 | \&\|', `\|\c | |
1497 | .B cc1\c | |
1498 | \&\|' (or, for C++, `\|\c | |
1499 | .B cc1plus\c | |
1500 | \&\|'), `\|\c | |
1501 | .B as\c | |
1502 | \&\|' and `\|\c | |
1503 | .B ld\c | |
1504 | \&\|'. It tries | |
1505 | .I prefix\c | |
1506 | \& as a prefix for each program it tries to run, both with and | |
1507 | without `\|\c | |
1508 | .I machine\c | |
1509 | .B /\c | |
1510 | .I version\c | |
1511 | .B /\c | |
1512 | \&\|'. | |
1513 | .Sp | |
1514 | For each subprogram to be run, the compiler driver first tries the | |
1515 | `\|\c | |
1516 | .B \-B\c | |
1517 | \&\|' prefix, if any. If that name is not found, or if `\|\c | |
1518 | .B \-B\c | |
1519 | \&\|' | |
1520 | was not specified, the driver tries two standard prefixes, which are | |
1521 | `\|\c | |
1522 | .B /usr/lib/gcc/\c | |
1523 | \&\|' and `\|\c | |
1524 | .B /usr/local/lib/gcc-lib/\c | |
1525 | \&\|'. If neither of | |
1526 | those results in a file name that is found, the compiler driver | |
1527 | searches for the unmodified program | |
1528 | name, using the directories specified in your | |
1529 | `\|\c | |
1530 | .B PATH\c | |
1531 | \&\|' environment variable. | |
1532 | .Sp | |
1533 | The run-time support file `\|\c | |
1534 | .B libgcc.a\c | |
1535 | \&\|' is also searched for using the | |
1536 | `\|\c | |
1537 | .B \-B\c | |
1538 | \&\|' prefix, if needed. If it is not found there, the two | |
1539 | standard prefixes above are tried, and that is all. The file is left | |
1540 | out of the link if it is not found by those means. Most of the time, | |
1541 | on most machines, `\|\c | |
1542 | .B libgcc.a\c | |
1543 | \&\|' is not actually necessary. | |
1544 | .Sp | |
1545 | You can get a similar result from the environment variable | |
1546 | .B GCC_EXEC_PREFIX\c | |
1547 | \&; if it is defined, its value is used as a prefix | |
1548 | in the same way. If both the `\|\c | |
1549 | .B \-B\c | |
1550 | \&\|' option and the | |
1551 | .B GCC_EXEC_PREFIX\c | |
1552 | \& variable are present, the `\|\c | |
1553 | .B \-B\c | |
1554 | \&\|' option is | |
1555 | used first and the environment variable value second. | |
1556 | .SH WARNING OPTIONS | |
1557 | Warnings are diagnostic messages that report constructions which | |
1558 | are not inherently erroneous but which are risky or suggest there | |
1559 | may have been an error. | |
1560 | .Sp | |
1561 | These options control the amount and kinds of warnings produced by GNU | |
1562 | CC: | |
1563 | .TP | |
1564 | .B \-fsyntax\-only | |
1565 | Check the code for syntax errors, but don't emit any output. | |
1566 | .TP | |
1567 | .B \-w | |
1568 | Inhibit all warning messages. | |
1569 | .TP | |
1570 | .B \-Wno\-import | |
1571 | Inhibit warning messages about the use of | |
1572 | .BR #import . | |
1573 | .TP | |
1574 | .B \-pedantic | |
1575 | Issue all the warnings demanded by strict ANSI standard C; reject | |
1576 | all programs that use forbidden extensions. | |
1577 | .Sp | |
1578 | Valid ANSI standard C programs should compile properly with or without | |
1579 | this option (though a rare few will require `\|\c | |
1580 | .B \-ansi\c | |
1581 | \&\|'). However, | |
1582 | without this option, certain GNU extensions and traditional C features | |
1583 | are supported as well. With this option, they are rejected. There is | |
1584 | no reason to \c | |
1585 | .I use\c | |
1586 | \& this option; it exists only to satisfy pedants. | |
1587 | .Sp | |
1588 | `\|\c | |
1589 | .B \-pedantic\c | |
1590 | \&\|' does not cause warning messages for use of the | |
1591 | alternate keywords whose names begin and end with `\|\c | |
1592 | .B _\|_\c | |
1593 | \&\|'. Pedantic | |
1594 | warnings are also disabled in the expression that follows | |
1595 | .B _\|_extension_\|_\c | |
1596 | \&. However, only system header files should use | |
1597 | these escape routes; application programs should avoid them. | |
1598 | .TP | |
1599 | .B \-pedantic\-errors | |
1600 | Like `\|\c | |
1601 | .B \-pedantic\c | |
1602 | \&\|', except that errors are produced rather than | |
1603 | warnings. | |
1604 | .TP | |
1605 | .B \-W | |
1606 | Print extra warning messages for these events: | |
1607 | .TP | |
1608 | \ \ \ \(bu | |
1609 | A nonvolatile automatic variable might be changed by a call to | |
1610 | .B longjmp\c | |
1611 | \&. These warnings are possible only in | |
1612 | optimizing compilation. | |
1613 | .Sp | |
1614 | The compiler sees only the calls to \c | |
1615 | .B setjmp\c | |
1616 | \&. It cannot know | |
1617 | where \c | |
1618 | .B longjmp\c | |
1619 | \& will be called; in fact, a signal handler could | |
1620 | call it at any point in the code. As a result, you may get a warning | |
1621 | even when there is in fact no problem because \c | |
1622 | .B longjmp\c | |
1623 | \& cannot | |
1624 | in fact be called at the place which would cause a problem. | |
1625 | .TP | |
1626 | \ \ \ \(bu | |
1627 | A function can return either with or without a value. (Falling | |
1628 | off the end of the function body is considered returning without | |
1629 | a value.) For example, this function would evoke such a | |
1630 | warning: | |
1631 | .Sp | |
1632 | .nf | |
1633 | foo (a) | |
1634 | { | |
1635 | if (a > 0) | |
1636 | return a; | |
1637 | } | |
1638 | .Sp | |
1639 | .fi | |
1640 | Spurious warnings can occur because GNU CC does not realize that | |
1641 | certain functions (including \c | |
1642 | .B abort\c | |
1643 | \& and \c | |
1644 | .B longjmp\c | |
1645 | \&) | |
1646 | will never return. | |
1647 | .TP | |
1648 | \ \ \ \(bu | |
1649 | An expression-statement or the left-hand side of a comma expression | |
1650 | contains no side effects. | |
1651 | To suppress the warning, cast the unused expression to void. | |
1652 | For example, an expression such as `\|\c | |
1653 | .B x[i,j]\c | |
1654 | \&\|' will cause a warning, | |
1655 | but `\|\c | |
1656 | .B x[(void)i,j]\c | |
1657 | \&\|' will not. | |
1658 | .TP | |
1659 | \ \ \ \(bu | |
1660 | An unsigned value is compared against zero with `\|\c | |
1661 | .B >\c | |
1662 | \&\|' or `\|\c | |
1663 | .B <=\c | |
1664 | \&\|'. | |
1665 | .PP | |
1666 | .TP | |
f2d76545 JL |
1667 | .B \-Wimplicit-int |
1668 | Warn whenever a declaration does not specify a type. | |
1669 | .TP | |
1670 | .B \-Wimplicit-function-declaration | |
1671 | Warn whenever a function is used before being declared. | |
1672 | .TP | |
861bb6c1 | 1673 | .B \-Wimplicit |
f2d76545 | 1674 | Same as -Wimplicit-int and -Wimplicit-function-declaration. |
861bb6c1 JL |
1675 | .TP |
1676 | .B \-Wmain | |
1677 | Warn if the | |
1678 | .B main | |
1679 | function is declared or defined with a suspicious type. | |
1680 | Typically, it is a function with external linkage, returning | |
1681 | .B int\c | |
1682 | \&, and | |
1683 | taking zero or two arguments. | |
1684 | ||
1685 | .TP | |
1686 | .B \-Wreturn\-type | |
1687 | Warn whenever a function is defined with a return-type that defaults | |
1688 | to \c | |
1689 | .B int\c | |
1690 | \&. Also warn about any \c | |
1691 | .B return\c | |
1692 | \& statement with no | |
1693 | return-value in a function whose return-type is not \c | |
1694 | .B void\c | |
1695 | \&. | |
1696 | .TP | |
1697 | .B \-Wunused | |
1698 | Warn whenever a local variable is unused aside from its declaration, | |
1699 | whenever a function is declared static but never defined, and whenever | |
1700 | a statement computes a result that is explicitly not used. | |
1701 | .TP | |
1702 | .B \-Wswitch | |
1703 | Warn whenever a \c | |
1704 | .B switch\c | |
1705 | \& statement has an index of enumeral type | |
1706 | and lacks a \c | |
1707 | .B case\c | |
1708 | \& for one or more of the named codes of that | |
1709 | enumeration. (The presence of a \c | |
1710 | .B default\c | |
1711 | \& label prevents this | |
1712 | warning.) \c | |
1713 | .B case\c | |
1714 | \& labels outside the enumeration range also | |
1715 | provoke warnings when this option is used. | |
1716 | .TP | |
1717 | .B \-Wcomment | |
1718 | Warn whenever a comment-start sequence `\|\c | |
1719 | .B /\(**\c | |
1720 | \&\|' appears in a comment. | |
1721 | .TP | |
1722 | .B \-Wtrigraphs | |
1723 | Warn if any trigraphs are encountered (assuming they are enabled). | |
1724 | .TP | |
1725 | .B \-Wformat | |
1726 | Check calls to \c | |
1727 | .B printf\c | |
1728 | \& and \c | |
1729 | .B scanf\c | |
1730 | \&, etc., to make sure that | |
1731 | the arguments supplied have types appropriate to the format string | |
1732 | specified. | |
1733 | .TP | |
1734 | .B \-Wchar\-subscripts | |
1735 | Warn if an array subscript has type | |
1736 | .BR char . | |
1737 | This is a common cause of error, as programmers often forget that this | |
1738 | type is signed on some machines. | |
1739 | .TP | |
1740 | .B \-Wuninitialized | |
1741 | An automatic variable is used without first being initialized. | |
1742 | .Sp | |
1743 | These warnings are possible only in optimizing compilation, | |
1744 | because they require data flow information that is computed only | |
1745 | when optimizing. If you don't specify `\|\c | |
1746 | .B \-O\c | |
1747 | \&\|', you simply won't | |
1748 | get these warnings. | |
1749 | .Sp | |
1750 | These warnings occur only for variables that are candidates for | |
1751 | register allocation. Therefore, they do not occur for a variable that | |
1752 | is declared \c | |
1753 | .B volatile\c | |
1754 | \&, or whose address is taken, or whose size | |
1755 | is other than 1, 2, 4 or 8 bytes. Also, they do not occur for | |
1756 | structures, unions or arrays, even when they are in registers. | |
1757 | .Sp | |
1758 | Note that there may be no warning about a variable that is used only | |
1759 | to compute a value that itself is never used, because such | |
1760 | computations may be deleted by data flow analysis before the warnings | |
1761 | are printed. | |
1762 | .Sp | |
1763 | These warnings are made optional because GNU CC is not smart | |
1764 | enough to see all the reasons why the code might be correct | |
1765 | despite appearing to have an error. Here is one example of how | |
1766 | this can happen: | |
1767 | .Sp | |
1768 | .nf | |
1769 | { | |
1770 | int x; | |
1771 | switch (y) | |
1772 | { | |
1773 | case 1: x = 1; | |
1774 | break; | |
1775 | case 2: x = 4; | |
1776 | break; | |
1777 | case 3: x = 5; | |
1778 | } | |
1779 | foo (x); | |
1780 | } | |
1781 | .Sp | |
1782 | .fi | |
1783 | If the value of \c | |
1784 | .B y\c | |
1785 | \& is always 1, 2 or 3, then \c | |
1786 | .B x\c | |
1787 | \& is | |
1788 | always initialized, but GNU CC doesn't know this. Here is | |
1789 | another common case: | |
1790 | .Sp | |
1791 | .nf | |
1792 | { | |
1793 | int save_y; | |
1794 | if (change_y) save_y = y, y = new_y; | |
1795 | .\|.\|. | |
1796 | if (change_y) y = save_y; | |
1797 | } | |
1798 | .Sp | |
1799 | .fi | |
1800 | This has no bug because \c | |
1801 | .B save_y\c | |
1802 | \& is used only if it is set. | |
1803 | .Sp | |
1804 | Some spurious warnings can be avoided if you declare as | |
1805 | .B volatile\c | |
1806 | \& all the functions you use that never return. | |
1807 | .TP | |
1808 | .B \-Wparentheses | |
1809 | Warn if parentheses are omitted in certain contexts. | |
1810 | .TP | |
861bb6c1 JL |
1811 | .B \-Wall |
1812 | All of the above `\|\c | |
1813 | .B \-W\c | |
1814 | \&\|' options combined. These are all the | |
1815 | options which pertain to usage that we recommend avoiding and that we | |
1816 | believe is easy to avoid, even in conjunction with macros. | |
1817 | .PP | |
1818 | The remaining `\|\c | |
1819 | .B \-W.\|.\|.\c | |
1820 | \&\|' options are not implied by `\|\c | |
1821 | .B \-Wall\c | |
1822 | \&\|' | |
1823 | because they warn about constructions that we consider reasonable to | |
1824 | use, on occasion, in clean programs. | |
1825 | .TP | |
1826 | .B \-Wtraditional | |
1827 | Warn about certain constructs that behave differently in traditional and | |
1828 | ANSI C. | |
1829 | .TP | |
1830 | \ \ \ \(bu | |
1831 | Macro arguments occurring within string constants in the macro body. | |
1832 | These would substitute the argument in traditional C, but are part of | |
1833 | the constant in ANSI C. | |
1834 | .TP | |
1835 | \ \ \ \(bu | |
1836 | A function declared external in one block and then used after the end of | |
1837 | the block. | |
1838 | .TP | |
1839 | \ \ \ \(bu | |
1840 | A \c | |
1841 | .B switch\c | |
1842 | \& statement has an operand of type \c | |
1843 | .B long\c | |
1844 | \&. | |
1845 | .PP | |
1846 | .TP | |
1847 | .B \-Wshadow | |
1848 | Warn whenever a local variable shadows another local variable. | |
1849 | .TP | |
1850 | .BI "\-Wid\-clash\-" "len" | |
1851 | Warn whenever two distinct identifiers match in the first \c | |
1852 | .I len | |
1853 | characters. This may help you prepare a program that will compile | |
1854 | with certain obsolete, brain-damaged compilers. | |
1855 | .TP | |
1856 | .B \-Wpointer\-arith | |
1857 | Warn about anything that depends on the \*(lqsize of\*(rq a function type or | |
1858 | of \c | |
1859 | .B void\c | |
1860 | \&. GNU C assigns these types a size of 1, for | |
1861 | convenience in calculations with \c | |
1862 | .B void \(**\c | |
1863 | \& pointers and pointers | |
1864 | to functions. | |
1865 | .TP | |
1866 | .B \-Wcast\-qual | |
1867 | Warn whenever a pointer is cast so as to remove a type qualifier from | |
1868 | the target type. For example, warn if a \c | |
1869 | .B const char \(**\c | |
1870 | \& is cast | |
1871 | to an ordinary \c | |
1872 | .B char \(**\c | |
1873 | \&. | |
1874 | .TP | |
1875 | .B \-Wcast\-align | |
1876 | Warn whenever a pointer is cast such that the required alignment of the | |
1877 | target is increased. For example, warn if a \c | |
1878 | .B char \(**\c | |
1879 | \& is cast to | |
1880 | an \c | |
1881 | .B int \(**\c | |
1882 | \& on machines where integers can only be accessed at | |
1883 | two- or four-byte boundaries. | |
1884 | .TP | |
1885 | .B \-Wwrite\-strings | |
1886 | Give string constants the type \c | |
1887 | .B const char[\c | |
1888 | .I length\c | |
1889 | .B ]\c | |
1890 | \& so that | |
1891 | copying the address of one into a non-\c | |
1892 | .B const\c | |
1893 | \& \c | |
1894 | .B char \(** | |
1895 | pointer will get a warning. These warnings will help you find at | |
1896 | compile time code that can try to write into a string constant, but | |
1897 | only if you have been very careful about using \c | |
1898 | .B const\c | |
1899 | \& in | |
1900 | declarations and prototypes. Otherwise, it will just be a nuisance; | |
1901 | this is why we did not make `\|\c | |
1902 | .B \-Wall\c | |
1903 | \&\|' request these warnings. | |
1904 | .TP | |
1905 | .B \-Wconversion | |
1906 | Warn if a prototype causes a type conversion that is different from what | |
1907 | would happen to the same argument in the absence of a prototype. This | |
1908 | includes conversions of fixed point to floating and vice versa, and | |
1909 | conversions changing the width or signedness of a fixed point argument | |
1910 | except when the same as the default promotion. | |
1911 | .TP | |
1912 | .B \-Waggregate\-return | |
1913 | Warn if any functions that return structures or unions are defined or | |
1914 | called. (In languages where you can return an array, this also elicits | |
1915 | a warning.) | |
1916 | .TP | |
1917 | .B \-Wstrict\-prototypes | |
1918 | Warn if a function is declared or defined without specifying the | |
1919 | argument types. (An old-style function definition is permitted without | |
1920 | a warning if preceded by a declaration which specifies the argument | |
1921 | types.) | |
1922 | .TP | |
1923 | .B \-Wmissing\-prototypes | |
1924 | Warn if a global function is defined without a previous prototype | |
1925 | declaration. This warning is issued even if the definition itself | |
1926 | provides a prototype. The aim is to detect global functions that fail | |
1927 | to be declared in header files. | |
1928 | .TP | |
1929 | .B \-Wmissing\-declarations | |
1930 | Warn if a global function is defined without a previous declaration. | |
1931 | Do so even if the definition itself provides a prototype. | |
1932 | Use this option to detect global functions that are not declared in | |
1933 | header files. | |
1934 | .TP | |
1935 | .B \-Wredundant-decls | |
1936 | Warn if anything is declared more than once in the same scope, even in | |
1937 | cases where multiple declaration is valid and changes nothing. | |
1938 | .TP | |
795add94 VM |
1939 | .B \-Wlong-long |
1940 | Warn if | |
1941 | .B long long \c | |
1942 | type is used. This is default. To inhibit | |
1943 | the warning messages, use flag `\|\c | |
1944 | .B \-Wno\-long\-long\c | |
1945 | \&\|'. Flags `\|\c | |
1946 | .B \-W\-long\-long\c | |
1947 | \&\|' and `\|\c | |
1948 | .B \-Wno\-long\-long\c | |
1949 | \&\|' are taken into account only when flag `\|\c | |
1950 | .B \-pedantic\c | |
1951 | \&\|' is used. | |
1952 | .TP | |
861bb6c1 JL |
1953 | .B \-Woverloaded\-virtual |
1954 | (C++ only.) | |
1955 | In a derived class, the definitions of virtual functions must match | |
1956 | the type signature of a virtual function declared in the base class. | |
1957 | Use this option to request warnings when a derived class declares a | |
1958 | function that may be an erroneous attempt to define a virtual | |
1959 | function: that is, warn when a function with the same name as a | |
1960 | virtual function in the base class, but with a type signature that | |
1961 | doesn't match any virtual functions from the base class. | |
1962 | .TP | |
1963 | .B \-Winline | |
1964 | Warn if a function can not be inlined, and either it was declared as inline, | |
1965 | or else the | |
1966 | .B \-finline\-functions | |
1967 | option was given. | |
1968 | .TP | |
1969 | .B \-Werror | |
1970 | Treat warnings as errors; abort compilation after any warning. | |
1971 | .SH DEBUGGING OPTIONS | |
1972 | GNU CC has various special options that are used for debugging | |
1973 | either your program or GCC: | |
1974 | .TP | |
1975 | .B \-g | |
1976 | Produce debugging information in the operating system's native format | |
1977 | (stabs, COFF, XCOFF, or DWARF). GDB can work with this debugging | |
1978 | information. | |
1979 | .Sp | |
1980 | On most systems that use stabs format, `\|\c | |
1981 | .B \-g\c | |
1982 | \&\|' enables use of extra | |
1983 | debugging information that only GDB can use; this extra information | |
1984 | makes debugging work better in GDB but will probably make other debuggers | |
1985 | crash or | |
1986 | refuse to read the program. If you want to control for certain whether | |
1987 | to generate the extra information, use `\|\c | |
1988 | .B \-gstabs+\c | |
1989 | \&\|', `\|\c | |
1990 | .B \-gstabs\c | |
1991 | \&\|', | |
1992 | `\|\c | |
1993 | .B \-gxcoff+\c | |
1994 | \&\|', `\|\c | |
1995 | .B \-gxcoff\c | |
1996 | \&\|', `\|\c | |
1997 | .B \-gdwarf+\c | |
1998 | \&\|', or `\|\c | |
1999 | .B \-gdwarf\c | |
2000 | \&\|' | |
2001 | (see below). | |
2002 | .Sp | |
2003 | Unlike most other C compilers, GNU CC allows you to use `\|\c | |
2004 | .B \-g\c | |
2005 | \&\|' with | |
2006 | `\|\c | |
2007 | .B \-O\c | |
2008 | \&\|'. The shortcuts taken by optimized code may occasionally | |
2009 | produce surprising results: some variables you declared may not exist | |
2010 | at all; flow of control may briefly move where you did not expect it; | |
2011 | some statements may not be executed because they compute constant | |
2012 | results or their values were already at hand; some statements may | |
2013 | execute in different places because they were moved out of loops. | |
2014 | .Sp | |
2015 | Nevertheless it proves possible to debug optimized output. This makes | |
2016 | it reasonable to use the optimizer for programs that might have bugs. | |
2017 | .PP | |
2018 | The following options are useful when GNU CC is generated with the | |
2019 | capability for more than one debugging format. | |
2020 | .TP | |
2021 | .B \-ggdb | |
2022 | Produce debugging information in the native format (if that is supported), | |
2023 | including GDB extensions if at all possible. | |
2024 | .TP | |
2025 | .B \-gstabs | |
2026 | Produce debugging information in stabs format (if that is supported), | |
2027 | without GDB extensions. This is the format used by DBX on most BSD | |
2028 | systems. | |
2029 | .TP | |
2030 | .B \-gstabs+ | |
2031 | Produce debugging information in stabs format (if that is supported), | |
2032 | using GNU extensions understood only by the GNU debugger (GDB). The | |
2033 | use of these extensions is likely to make other debuggers crash or | |
2034 | refuse to read the program. | |
2035 | .TP | |
2036 | .B \-gcoff | |
2037 | Produce debugging information in COFF format (if that is supported). | |
2038 | This is the format used by SDB on most System V systems prior to | |
2039 | System V Release 4. | |
2040 | .TP | |
2041 | .B \-gxcoff | |
2042 | Produce debugging information in XCOFF format (if that is supported). | |
2043 | This is the format used by the DBX debugger on IBM RS/6000 systems. | |
2044 | .TP | |
2045 | .B \-gxcoff+ | |
2046 | Produce debugging information in XCOFF format (if that is supported), | |
2047 | using GNU extensions understood only by the GNU debugger (GDB). The | |
2048 | use of these extensions is likely to make other debuggers crash or | |
2049 | refuse to read the program. | |
2050 | .TP | |
2051 | .B \-gdwarf | |
2052 | Produce debugging information in DWARF format (if that is supported). | |
2053 | This is the format used by SDB on most System V Release 4 systems. | |
2054 | .TP | |
2055 | .B \-gdwarf+ | |
2056 | Produce debugging information in DWARF format (if that is supported), | |
2057 | using GNU extensions understood only by the GNU debugger (GDB). The | |
2058 | use of these extensions is likely to make other debuggers crash or | |
2059 | refuse to read the program. | |
2060 | .PP | |
2061 | .BI "\-g" "level" | |
2062 | .br | |
2063 | .BI "\-ggdb" "level" | |
2064 | .br | |
2065 | .BI "\-gstabs" "level" | |
2066 | .br | |
2067 | .BI "\-gcoff" "level" | |
2068 | .BI "\-gxcoff" "level" | |
2069 | .TP | |
2070 | .BI "\-gdwarf" "level" | |
2071 | Request debugging information and also use \c | |
2072 | .I level\c | |
2073 | \& to specify how | |
2074 | much information. The default level is 2. | |
2075 | .Sp | |
2076 | Level 1 produces minimal information, enough for making backtraces in | |
2077 | parts of the program that you don't plan to debug. This includes | |
2078 | descriptions of functions and external variables, but no information | |
2079 | about local variables and no line numbers. | |
2080 | .Sp | |
2081 | Level 3 includes extra information, such as all the macro definitions | |
2082 | present in the program. Some debuggers support macro expansion when | |
2083 | you use `\|\c | |
2084 | .B \-g3\c | |
2085 | \&\|'. | |
2086 | .TP | |
2087 | .B \-p | |
2088 | Generate extra code to write profile information suitable for the | |
2089 | analysis program \c | |
2090 | .B prof\c | |
2091 | \&. | |
2092 | .TP | |
2093 | .B \-pg | |
2094 | Generate extra code to write profile information suitable for the | |
2095 | analysis program \c | |
2096 | .B gprof\c | |
2097 | \&. | |
2098 | .TP | |
2099 | .B \-a | |
2100 | Generate extra code to write profile information for basic blocks, | |
2101 | which will record the number of times each basic block is executed. | |
2102 | This data could be analyzed by a program like \c | |
2103 | .B tcov\c | |
2104 | \&. Note, | |
2105 | however, that the format of the data is not what \c | |
2106 | .B tcov\c | |
2107 | \& expects. | |
2108 | Eventually GNU \c | |
2109 | .B gprof\c | |
2110 | \& should be extended to process this data. | |
2111 | .TP | |
2112 | .B \-ax | |
2113 | Generate extra code to read basic block profiling parameters from | |
2114 | file `bb.in' and write profiling results to file `bb.out'. | |
2115 | `bb.in' contains a list of functions. Whenever a function on the list | |
2116 | is entered, profiling is turned on. When the outmost function is left, | |
2117 | profiling is turned off. If a function name is prefixed with `-' | |
2118 | the function is excluded from profiling. If a function name is not | |
2119 | unique it can be disambiguated by writing | |
2120 | `/path/filename.d:functionname'. `bb.out' will list some available | |
2121 | filenames. | |
2122 | Four function names have a special meaning: | |
2123 | `__bb_jumps__' will cause jump frequencies to be written to `bb.out'. | |
2124 | `__bb_trace__' will cause the sequence of basic blocks to be piped | |
2125 | into `gzip' and written to file `bbtrace.gz'. | |
2126 | `__bb_hidecall__' will cause call instructions to be excluded from | |
2127 | the trace. | |
2128 | `__bb_showret__' will cause return instructions to be included in | |
2129 | the trace. | |
2130 | .TP | |
2131 | .BI "\-d" "letters" | |
2132 | Says to make debugging dumps during compilation at times specified by | |
2133 | .I letters\c | |
2134 | \&. This is used for debugging the compiler. The file names | |
2135 | for most of the dumps are made by appending a word to the source file | |
2136 | name (e.g. `\|\c | |
2137 | .B foo.c.rtl\c | |
2138 | \&\|' or `\|\c | |
2139 | .B foo.c.jump\c | |
2140 | \&\|'). | |
2141 | .TP | |
2142 | .B \-dM | |
2143 | Dump all macro definitions, at the end of preprocessing, and write no | |
2144 | output. | |
2145 | .TP | |
2146 | .B \-dN | |
2147 | Dump all macro names, at the end of preprocessing. | |
2148 | .TP | |
2149 | .B \-dD | |
2150 | Dump all macro definitions, at the end of preprocessing, in addition to | |
2151 | normal output. | |
2152 | .TP | |
2153 | .B \-dy | |
2154 | Dump debugging information during parsing, to standard error. | |
2155 | .TP | |
2156 | .B \-dr | |
2157 | Dump after RTL generation, to `\|\c | |
2158 | .I file\c | |
2159 | .B \&.rtl\c | |
2160 | \&\|'. | |
2161 | .TP | |
2162 | .B \-dx | |
2163 | Just generate RTL for a function instead of compiling it. Usually used | |
2164 | with `\|\c | |
2165 | .B r\c | |
2166 | \&\|'. | |
2167 | .TP | |
2168 | .B \-dj | |
2169 | Dump after first jump optimization, to `\|\c | |
2170 | .I file\c | |
2171 | .B \&.jump\c | |
2172 | \&\|'. | |
2173 | .TP | |
2174 | .B \-ds | |
2175 | Dump after CSE (including the jump optimization that sometimes | |
2176 | follows CSE), to `\|\c | |
2177 | .I file\c | |
2178 | .B \&.cse\c | |
2179 | \&\|'. | |
2180 | .TP | |
2181 | .B \-dL | |
2182 | Dump after loop optimization, to `\|\c | |
2183 | .I file\c | |
2184 | .B \&.loop\c | |
2185 | \&\|'. | |
2186 | .TP | |
2187 | .B \-dt | |
2188 | Dump after the second CSE pass (including the jump optimization that | |
2189 | sometimes follows CSE), to `\|\c | |
2190 | .I file\c | |
2191 | .B \&.cse2\c | |
2192 | \&\|'. | |
2193 | .TP | |
2194 | .B \-df | |
2195 | Dump after flow analysis, to `\|\c | |
2196 | .I file\c | |
2197 | .B \&.flow\c | |
2198 | \&\|'. | |
2199 | .TP | |
2200 | .B \-dc | |
2201 | Dump after instruction combination, to `\|\c | |
2202 | .I file\c | |
2203 | .B \&.combine\c | |
2204 | \&\|'. | |
2205 | .TP | |
2206 | .B \-dS | |
2207 | Dump after the first instruction scheduling pass, to | |
2208 | `\|\c | |
2209 | .I file\c | |
2210 | .B \&.sched\c | |
2211 | \&\|'. | |
2212 | .TP | |
2213 | .B \-dl | |
2214 | Dump after local register allocation, to `\|\c | |
2215 | .I file\c | |
2216 | .B \&.lreg\c | |
2217 | \&\|'. | |
2218 | .TP | |
2219 | .B \-dg | |
2220 | Dump after global register allocation, to `\|\c | |
2221 | .I file\c | |
2222 | .B \&.greg\c | |
2223 | \&\|'. | |
2224 | .TP | |
2225 | .B \-dR | |
2226 | Dump after the second instruction scheduling pass, to | |
2227 | `\|\c | |
2228 | .I file\c | |
2229 | .B \&.sched2\c | |
2230 | \&\|'. | |
2231 | .TP | |
2232 | .B \-dJ | |
2233 | Dump after last jump optimization, to `\|\c | |
2234 | .I file\c | |
2235 | .B \&.jump2\c | |
2236 | \&\|'. | |
2237 | .TP | |
2238 | .B \-dd | |
2239 | Dump after delayed branch scheduling, to `\|\c | |
2240 | .I file\c | |
2241 | .B \&.dbr\c | |
2242 | \&\|'. | |
2243 | .TP | |
2244 | .B \-dk | |
2245 | Dump after conversion from registers to stack, to `\|\c | |
2246 | .I file\c | |
2247 | .B \&.stack\c | |
2248 | \&\|'. | |
2249 | .TP | |
2250 | .B \-da | |
2251 | Produce all the dumps listed above. | |
2252 | .TP | |
2253 | .B \-dm | |
2254 | Print statistics on memory usage, at the end of the run, to | |
2255 | standard error. | |
2256 | .TP | |
2257 | .B \-dp | |
2258 | Annotate the assembler output with a comment indicating which | |
2259 | pattern and alternative was used. | |
2260 | .TP | |
2261 | .B \-fpretend\-float | |
2262 | When running a cross-compiler, pretend that the target machine uses the | |
2263 | same floating point format as the host machine. This causes incorrect | |
2264 | output of the actual floating constants, but the actual instruction | |
2265 | sequence will probably be the same as GNU CC would make when running on | |
2266 | the target machine. | |
2267 | .TP | |
2268 | .B \-save\-temps | |
2269 | Store the usual \*(lqtemporary\*(rq intermediate files permanently; place them | |
2270 | in the current directory and name them based on the source file. Thus, | |
2271 | compiling `\|\c | |
2272 | .B foo.c\c | |
2273 | \&\|' with `\|\c | |
2274 | .B \-c \-save\-temps\c | |
2275 | \&\|' would produce files | |
2276 | `\|\c | |
2277 | .B foo.cpp\c | |
2278 | \&\|' and `\|\c | |
2279 | .B foo.s\c | |
2280 | \&\|', as well as `\|\c | |
2281 | .B foo.o\c | |
2282 | \&\|'. | |
2283 | .TP | |
2284 | .BI "\-print\-file\-name=" "library" | |
2285 | Print the full absolute name of the library file \|\c | |
2286 | .nh | |
2287 | .I library | |
2288 | .hy | |
2289 | \&\| that | |
2290 | would be used when linking\(em\&and do not do anything else. With this | |
2291 | option, GNU CC does not compile or link anything; it just prints the | |
2292 | file name. | |
2293 | .TP | |
2294 | .B \-print\-libgcc\-file\-name | |
2295 | Same as `\|\c | |
2296 | .B \-print\-file\-name=libgcc.a\c | |
2297 | \&\|'. | |
2298 | .TP | |
2299 | .BI "\-print\-prog\-name=" "program" | |
2300 | Like `\|\c | |
2301 | .B \-print\-file\-name\c | |
2302 | \&\|', but searches for a program such as `\|\c | |
2303 | cpp\c | |
2304 | \&\|'. | |
2305 | .SH OPTIMIZATION OPTIONS | |
2306 | These options control various sorts of optimizations: | |
2307 | .TP | |
2308 | .B \-O | |
2309 | .TP | |
2310 | .B \-O1 | |
2311 | Optimize. Optimizing compilation takes somewhat more time, and a lot | |
2312 | more memory for a large function. | |
2313 | .Sp | |
2314 | Without `\|\c | |
2315 | .B \-O\c | |
2316 | \&\|', the compiler's goal is to reduce the cost of | |
2317 | compilation and to make debugging produce the expected results. | |
2318 | Statements are independent: if you stop the program with a breakpoint | |
2319 | between statements, you can then assign a new value to any variable or | |
2320 | change the program counter to any other statement in the function and | |
2321 | get exactly the results you would expect from the source code. | |
2322 | .Sp | |
2323 | Without `\|\c | |
2324 | .B \-O\c | |
2325 | \&\|', only variables declared \c | |
2326 | .B register\c | |
2327 | \& are | |
2328 | allocated in registers. The resulting compiled code is a little worse | |
2329 | than produced by PCC without `\|\c | |
2330 | .B \-O\c | |
2331 | \&\|'. | |
2332 | .Sp | |
2333 | With `\|\c | |
2334 | .B \-O\c | |
2335 | \&\|', the compiler tries to reduce code size and execution | |
2336 | time. | |
2337 | .Sp | |
2338 | When you specify `\|\c | |
2339 | .B \-O\c | |
2340 | \&\|', the two options `\|\c | |
2341 | .B \-fthread\-jumps\c | |
2342 | \&\|' and `\|\c | |
2343 | .B \-fdefer\-pop\c | |
2344 | \&\|' are turned on. On machines that have delay slots, the `\|\c | |
2345 | .B \-fdelayed\-branch\c | |
2346 | \&\|' option is turned on. For those machines that can support debugging even | |
2347 | without a frame pointer, the `\|\c | |
2348 | .B \-fomit\-frame\-pointer\c | |
2349 | \&\|' option is turned on. On some machines other flags may also be turned on. | |
2350 | .TP | |
2351 | .B \-O2 | |
2352 | Optimize even more. Nearly all supported optimizations that do not | |
2353 | involve a space-speed tradeoff are performed. Loop unrolling and function | |
2354 | inlining are not done, for example. As compared to | |
2355 | .B \-O\c | |
2356 | \&, | |
2357 | this option increases both compilation time and the performance of the | |
2358 | generated code. | |
2359 | .TP | |
2360 | .B \-O3 | |
2361 | Optimize yet more. This turns on everything | |
2362 | .B \-O2 | |
2363 | does, along with also turning on | |
2364 | .B \-finline\-functions. | |
2365 | .TP | |
2366 | .B \-O0 | |
2367 | Do not optimize. | |
2368 | .Sp | |
2369 | If you use multiple | |
2370 | .B \-O | |
2371 | options, with or without level numbers, the last such option is the | |
2372 | one that is effective. | |
2373 | .PP | |
2374 | Options of the form `\|\c | |
2375 | .B \-f\c | |
2376 | .I flag\c | |
2377 | \&\c | |
2378 | \&\|' specify machine-independent | |
2379 | flags. Most flags have both positive and negative forms; the negative | |
2380 | form of `\|\c | |
2381 | .B \-ffoo\c | |
2382 | \&\|' would be `\|\c | |
2383 | .B \-fno\-foo\c | |
2384 | \&\|'. The following list shows | |
2385 | only one form\(em\&the one which is not the default. | |
2386 | You can figure out the other form by either removing `\|\c | |
2387 | .B no\-\c | |
2388 | \&\|' or | |
2389 | adding it. | |
2390 | .TP | |
2391 | .B \-ffloat\-store | |
2392 | Do not store floating point variables in registers. This | |
2393 | prevents undesirable excess precision on machines such as the | |
2394 | 68000 where the floating registers (of the 68881) keep more | |
2395 | precision than a \c | |
2396 | .B double\c | |
2397 | \& is supposed to have. | |
2398 | .Sp | |
2399 | For most programs, the excess precision does only good, but a few | |
2400 | programs rely on the precise definition of IEEE floating point. | |
2401 | Use `\|\c | |
2402 | .B \-ffloat\-store\c | |
2403 | \&\|' for such programs. | |
2404 | .TP | |
2405 | .B \-fmemoize\-lookups | |
2406 | .TP | |
2407 | .B \-fsave\-memoized | |
2408 | Use heuristics to compile faster (C++ only). These heuristics are not | |
2409 | enabled by default, since they are only effective for certain input | |
2410 | files. Other input files compile more slowly. | |
2411 | .Sp | |
2412 | The first time the compiler must build a call to a member function (or | |
2413 | reference to a data member), it must (1) determine whether the class | |
2414 | implements member functions of that name; (2) resolve which member | |
2415 | function to call (which involves figuring out what sorts of type | |
2416 | conversions need to be made); and (3) check the visibility of the member | |
2417 | function to the caller. All of this adds up to slower compilation. | |
2418 | Normally, the second time a call is made to that member function (or | |
2419 | reference to that data member), it must go through the same lengthy | |
2420 | process again. This means that code like this | |
2421 | .Sp | |
2422 | \& cout << "This " << p << " has " << n << " legs.\en"; | |
2423 | .Sp | |
2424 | makes six passes through all three steps. By using a software cache, | |
2425 | a \*(lqhit\*(rq significantly reduces this cost. Unfortunately, using the | |
2426 | cache introduces another layer of mechanisms which must be implemented, | |
2427 | and so incurs its own overhead. `\|\c | |
2428 | .B \-fmemoize\-lookups\c | |
2429 | \&\|' enables | |
2430 | the software cache. | |
2431 | .Sp | |
2432 | Because access privileges (visibility) to members and member functions | |
2433 | may differ from one function context to the next, | |
2434 | .B g++ | |
2435 | may need to flush the cache. With the `\|\c | |
2436 | .B \-fmemoize\-lookups\c | |
2437 | \&\|' flag, the cache is flushed after every | |
2438 | function that is compiled. The `\|\c | |
2439 | \-fsave\-memoized\c | |
2440 | \&\|' flag enables the same software cache, but when the compiler | |
2441 | determines that the context of the last function compiled would yield | |
2442 | the same access privileges of the next function to compile, it | |
2443 | preserves the cache. | |
2444 | This is most helpful when defining many member functions for the same | |
2445 | class: with the exception of member functions which are friends of | |
2446 | other classes, each member function has exactly the same access | |
2447 | privileges as every other, and the cache need not be flushed. | |
2448 | .TP | |
2449 | .B \-fno\-default\-inline | |
2450 | Don't make member functions inline by default merely because they are | |
2451 | defined inside the class scope (C++ only). | |
2452 | .TP | |
2453 | .B \-fno\-defer\-pop | |
2454 | Always pop the arguments to each function call as soon as that | |
2455 | function returns. For machines which must pop arguments after a | |
2456 | function call, the compiler normally lets arguments accumulate on the | |
2457 | stack for several function calls and pops them all at once. | |
2458 | .TP | |
2459 | .B \-fforce\-mem | |
2460 | Force memory operands to be copied into registers before doing | |
2461 | arithmetic on them. This may produce better code by making all | |
2462 | memory references potential common subexpressions. When they are | |
2463 | not common subexpressions, instruction combination should | |
2464 | eliminate the separate register-load. I am interested in hearing | |
2465 | about the difference this makes. | |
2466 | .TP | |
2467 | .B \-fforce\-addr | |
2468 | Force memory address constants to be copied into registers before | |
2469 | doing arithmetic on them. This may produce better code just as | |
2470 | `\|\c | |
2471 | .B \-fforce\-mem\c | |
2472 | \&\|' may. I am interested in hearing about the | |
2473 | difference this makes. | |
2474 | .TP | |
2475 | .B \-fomit\-frame\-pointer | |
2476 | Don't keep the frame pointer in a register for functions that | |
2477 | don't need one. This avoids the instructions to save, set up and | |
2478 | restore frame pointers; it also makes an extra register available | |
2479 | in many functions. \c | |
2480 | .I It also makes debugging impossible on most machines\c | |
2481 | \&. | |
2482 | .Sp | |
2483 | On some machines, such as the Vax, this flag has no effect, because | |
2484 | the standard calling sequence automatically handles the frame pointer | |
2485 | and nothing is saved by pretending it doesn't exist. The | |
2486 | machine-description macro \c | |
2487 | .B FRAME_POINTER_REQUIRED\c | |
2488 | \& controls | |
2489 | whether a target machine supports this flag. | |
2490 | .TP | |
2491 | .B \-finline\-functions | |
2492 | Integrate all simple functions into their callers. The compiler | |
2493 | heuristically decides which functions are simple enough to be worth | |
2494 | integrating in this way. | |
2495 | .Sp | |
2496 | If all calls to a given function are integrated, and the function is | |
2497 | declared \c | |
2498 | .B static\c | |
2499 | \&, then GCC normally does not output the function as | |
2500 | assembler code in its own right. | |
2501 | .TP | |
2502 | .B \-fcaller\-saves | |
2503 | Enable values to be allocated in registers that will be clobbered by | |
2504 | function calls, by emitting extra instructions to save and restore the | |
2505 | registers around such calls. Such allocation is done only when it | |
2506 | seems to result in better code than would otherwise be produced. | |
2507 | .Sp | |
2508 | This option is enabled by default on certain machines, usually those | |
2509 | which have no call-preserved registers to use instead. | |
2510 | .TP | |
2511 | .B \-fkeep\-inline\-functions | |
2512 | Even if all calls to a given function are integrated, and the function | |
2513 | is declared \c | |
2514 | .B static\c | |
2515 | \&, nevertheless output a separate run-time | |
2516 | callable version of the function. | |
2517 | .TP | |
2518 | .B \-fno\-function\-cse | |
2519 | Do not put function addresses in registers; make each instruction that | |
2520 | calls a constant function contain the function's address explicitly. | |
2521 | .Sp | |
2522 | This option results in less efficient code, but some strange hacks | |
2523 | that alter the assembler output may be confused by the optimizations | |
2524 | performed when this option is not used. | |
2525 | .TP | |
2526 | .B \-fno\-peephole | |
2527 | Disable any machine-specific peephole optimizations. | |
2528 | .TP | |
2529 | .B \-ffast-math | |
2530 | This option allows GCC to violate some ANSI or IEEE rules/specifications | |
2531 | in the interest of optimizing code for speed. For example, it allows | |
2532 | the compiler to assume arguments to the \c | |
2533 | .B sqrt\c | |
2534 | \& function are | |
2535 | non-negative numbers. | |
2536 | .Sp | |
2537 | This option should never be turned on by any `\|\c | |
2538 | .B \-O\c | |
2539 | \&\|' option since | |
2540 | it can result in incorrect output for programs which depend on | |
2541 | an exact implementation of IEEE or ANSI rules/specifications for | |
2542 | math functions. | |
2543 | .PP | |
2544 | The following options control specific optimizations. The `\|\c | |
2545 | .B \-O2\c | |
2546 | \&\|' | |
2547 | option turns on all of these optimizations except `\|\c | |
2548 | .B \-funroll\-loops\c | |
2549 | \&\|' | |
2550 | and `\|\c | |
2551 | .B \-funroll\-all\-loops\c | |
2552 | \&\|'. | |
2553 | .PP | |
2554 | The `\|\c | |
2555 | .B \-O\c | |
2556 | \&\|' option usually turns on | |
2557 | the `\|\c | |
2558 | .B \-fthread\-jumps\c | |
2559 | \&\|' and `\|\c | |
2560 | .B \-fdelayed\-branch\c | |
2561 | \&\|' options, but | |
2562 | specific machines may change the default optimizations. | |
2563 | .PP | |
2564 | You can use the following flags in the rare cases when \*(lqfine-tuning\*(rq | |
2565 | of optimizations to be performed is desired. | |
2566 | .TP | |
2567 | .B \-fstrength\-reduce | |
2568 | Perform the optimizations of loop strength reduction and | |
2569 | elimination of iteration variables. | |
2570 | .TP | |
2571 | .B \-fthread\-jumps | |
2572 | Perform optimizations where we check to see if a jump branches to a | |
2573 | location where another comparison subsumed by the first is found. If | |
2574 | so, the first branch is redirected to either the destination of the | |
2575 | second branch or a point immediately following it, depending on whether | |
2576 | the condition is known to be true or false. | |
2577 | .TP | |
2578 | .B \-funroll\-loops | |
2579 | Perform the optimization of loop unrolling. This is only done for loops | |
2580 | whose number of iterations can be determined at compile time or run time. | |
2581 | .TP | |
2582 | .B \-funroll\-all\-loops | |
2583 | Perform the optimization of loop unrolling. This is done for all loops. | |
2584 | This usually makes programs run more slowly. | |
2585 | .TP | |
2586 | .B \-fcse\-follow\-jumps | |
2587 | In common subexpression elimination, scan through jump instructions | |
2588 | when the target of the jump is not reached by any other path. For | |
2589 | example, when CSE encounters an \c | |
2590 | .B if\c | |
2591 | \& statement with an | |
2592 | .B else\c | |
2593 | \& clause, CSE will follow the jump when the condition | |
2594 | tested is false. | |
2595 | .TP | |
2596 | .B \-fcse\-skip\-blocks | |
2597 | This is similar to `\|\c | |
2598 | .B \-fcse\-follow\-jumps\c | |
2599 | \&\|', but causes CSE to | |
2600 | follow jumps which conditionally skip over blocks. When CSE | |
2601 | encounters a simple \c | |
2602 | .B if\c | |
2603 | \& statement with no else clause, | |
2604 | `\|\c | |
2605 | .B \-fcse\-skip\-blocks\c | |
2606 | \&\|' causes CSE to follow the jump around the | |
2607 | body of the \c | |
2608 | .B if\c | |
2609 | \&. | |
2610 | .TP | |
2611 | .B \-frerun\-cse\-after\-loop | |
2612 | Re-run common subexpression elimination after loop optimizations has been | |
2613 | performed. | |
2614 | .TP | |
2615 | .B \-felide\-constructors | |
2616 | Elide constructors when this seems plausible (C++ only). With this | |
2617 | flag, GNU C++ initializes \c | |
2618 | .B y\c | |
2619 | \& directly from the call to \c | |
2620 | .B foo | |
2621 | without going through a temporary in the following code: | |
2622 | .Sp | |
2623 | A foo (); | |
2624 | A y = foo (); | |
2625 | .Sp | |
2626 | Without this option, GNU C++ first initializes \c | |
2627 | .B y\c | |
2628 | \& by calling the | |
2629 | appropriate constructor for type \c | |
2630 | .B A\c | |
2631 | \&; then assigns the result of | |
2632 | .B foo\c | |
2633 | \& to a temporary; and, finally, replaces the initial value of | |
2634 | `\|\c | |
2635 | .B y\c | |
2636 | \&\|' with the temporary. | |
2637 | .Sp | |
2638 | The default behavior (`\|\c | |
2639 | .B \-fno\-elide\-constructors\c | |
2640 | \&\|') is specified by | |
2641 | the draft ANSI C++ standard. If your program's constructors have side | |
2642 | effects, using `\|\c | |
2643 | .B \-felide-constructors\c | |
2644 | \&\|' can make your program act | |
2645 | differently, since some constructor calls may be omitted. | |
2646 | .TP | |
2647 | .B \-fexpensive\-optimizations | |
2648 | Perform a number of minor optimizations that are relatively expensive. | |
2649 | .TP | |
2650 | .B \-fdelayed\-branch | |
2651 | If supported for the target machine, attempt to reorder instructions | |
2652 | to exploit instruction slots available after delayed branch | |
2653 | instructions. | |
2654 | .TP | |
2655 | .B \-fschedule\-insns | |
2656 | If supported for the target machine, attempt to reorder instructions to | |
2657 | eliminate execution stalls due to required data being unavailable. This | |
2658 | helps machines that have slow floating point or memory load instructions | |
2659 | by allowing other instructions to be issued until the result of the load | |
2660 | or floating point instruction is required. | |
2661 | .TP | |
2662 | .B \-fschedule\-insns2 | |
2663 | Similar to `\|\c | |
2664 | .B \-fschedule\-insns\c | |
2665 | \&\|', but requests an additional pass of | |
2666 | instruction scheduling after register allocation has been done. This is | |
2667 | especially useful on machines with a relatively small number of | |
2668 | registers and where memory load instructions take more than one cycle. | |
2669 | .SH TARGET OPTIONS | |
2670 | By default, GNU CC compiles code for the same type of machine that you | |
2671 | are using. However, it can also be installed as a cross-compiler, to | |
2672 | compile for some other type of machine. In fact, several different | |
2673 | configurations of GNU CC, for different target machines, can be | |
2674 | installed side by side. Then you specify which one to use with the | |
2675 | `\|\c | |
2676 | .B \-b\c | |
2677 | \&\|' option. | |
2678 | .PP | |
2679 | In addition, older and newer versions of GNU CC can be installed side | |
2680 | by side. One of them (probably the newest) will be the default, but | |
2681 | you may sometimes wish to use another. | |
2682 | .TP | |
2683 | .BI "\-b " "machine" | |
2684 | The argument \c | |
2685 | .I machine\c | |
2686 | \& specifies the target machine for compilation. | |
2687 | This is useful when you have installed GNU CC as a cross-compiler. | |
2688 | .Sp | |
2689 | The value to use for \c | |
2690 | .I machine\c | |
2691 | \& is the same as was specified as the | |
2692 | machine type when configuring GNU CC as a cross-compiler. For | |
2693 | example, if a cross-compiler was configured with `\|\c | |
2694 | .B configure | |
2695 | i386v\c | |
2696 | \&\|', meaning to compile for an 80386 running System V, then you | |
2697 | would specify `\|\c | |
2698 | .B \-b i386v\c | |
2699 | \&\|' to run that cross compiler. | |
2700 | .Sp | |
2701 | When you do not specify `\|\c | |
2702 | .B \-b\c | |
2703 | \&\|', it normally means to compile for | |
2704 | the same type of machine that you are using. | |
2705 | .TP | |
2706 | .BI "\-V " "version" | |
2707 | The argument \c | |
2708 | .I version\c | |
2709 | \& specifies which version of GNU CC to run. | |
2710 | This is useful when multiple versions are installed. For example, | |
2711 | .I version\c | |
2712 | \& might be `\|\c | |
2713 | .B 2.0\c | |
2714 | \&\|', meaning to run GNU CC version 2.0. | |
2715 | .Sp | |
2716 | The default version, when you do not specify `\|\c | |
2717 | .B \-V\c | |
2718 | \&\|', is controlled | |
2719 | by the way GNU CC is installed. Normally, it will be a version that | |
2720 | is recommended for general use. | |
2721 | .SH MACHINE DEPENDENT OPTIONS | |
2722 | Each of the target machine types can have its own special options, | |
2723 | starting with `\|\c | |
2724 | .B \-m\c | |
2725 | \&\|', to choose among various hardware models or | |
2726 | configurations\(em\&for example, 68010 vs 68020, floating coprocessor or | |
2727 | none. A single installed version of the compiler can compile for any | |
2728 | model or configuration, according to the options specified. | |
2729 | .PP | |
2730 | Some configurations of the compiler also support additional special | |
2731 | options, usually for command-line compatibility with other compilers on | |
2732 | the same platform. | |
2733 | .PP | |
2734 | These are the `\|\c | |
2735 | .B \-m\c | |
2736 | \&\|' options defined for the 68000 series: | |
2737 | .TP | |
2738 | .B \-m68000 | |
2739 | .TP | |
2740 | .B \-mc68000 | |
2741 | Generate output for a 68000. This is the default when the compiler is | |
2742 | configured for 68000-based systems. | |
2743 | .TP | |
2744 | .B \-m68020 | |
2745 | .TP | |
2746 | .B \-mc68020 | |
2747 | Generate output for a 68020 (rather than a 68000). This is the | |
2748 | default when the compiler is configured for 68020-based systems. | |
2749 | .TP | |
2750 | .B \-m68881 | |
2751 | Generate output containing 68881 instructions for floating point. | |
2752 | This is the default for most 68020-based systems unless | |
2753 | .B \-nfp | |
2754 | was specified when the compiler was configured. | |
2755 | .TP | |
2756 | .B \-m68030 | |
2757 | Generate output for a 68030. This is the default when the compiler is | |
2758 | configured for 68030-based systems. | |
2759 | .TP | |
2760 | .B \-m68040 | |
2761 | Generate output for a 68040. This is the default when the compiler is | |
2762 | configured for 68040-based systems. | |
2763 | .TP | |
2764 | .B \-m68020\-40 | |
2765 | Generate output for a 68040, without using any of the new instructions. | |
2766 | This results in code which can run relatively efficiently on either a | |
2767 | 68020/68881 or a 68030 or a 68040. | |
2768 | .TP | |
2769 | .B \-mfpa | |
2770 | Generate output containing Sun FPA instructions for floating point. | |
2771 | .TP | |
2772 | .B \-msoft\-float | |
2773 | Generate output containing library calls for floating point. | |
2774 | .I | |
2775 | WARNING: | |
2776 | the requisite libraries are not part of GNU CC. Normally the | |
2777 | facilities of the machine's usual C compiler are used, but this can't | |
2778 | be done directly in cross-compilation. You must make your own | |
2779 | arrangements to provide suitable library functions for cross-compilation. | |
2780 | .TP | |
2781 | .B \-mshort | |
2782 | Consider type \c | |
2783 | .B int\c | |
2784 | \& to be 16 bits wide, like \c | |
2785 | .B short int\c | |
2786 | \&. | |
2787 | .TP | |
2788 | .B \-mnobitfield | |
2789 | Do not use the bit-field instructions. `\|\c | |
2790 | .B \-m68000\c | |
2791 | \&\|' implies | |
2792 | `\|\c | |
2793 | .B \-mnobitfield\c | |
2794 | \&\|'. | |
2795 | .TP | |
2796 | .B \-mbitfield | |
2797 | Do use the bit-field instructions. `\|\c | |
2798 | .B \-m68020\c | |
2799 | \&\|' implies | |
2800 | `\|\c | |
2801 | .B \-mbitfield\c | |
2802 | \&\|'. This is the default if you use the unmodified | |
2803 | sources. | |
2804 | .TP | |
2805 | .B \-mrtd | |
2806 | Use a different function-calling convention, in which functions | |
2807 | that take a fixed number of arguments return with the \c | |
2808 | .B rtd | |
2809 | instruction, which pops their arguments while returning. This | |
2810 | saves one instruction in the caller since there is no need to pop | |
2811 | the arguments there. | |
2812 | .Sp | |
2813 | This calling convention is incompatible with the one normally | |
2814 | used on Unix, so you cannot use it if you need to call libraries | |
2815 | compiled with the Unix compiler. | |
2816 | .Sp | |
2817 | Also, you must provide function prototypes for all functions that | |
2818 | take variable numbers of arguments (including \c | |
2819 | .B printf\c | |
2820 | \&); | |
2821 | otherwise incorrect code will be generated for calls to those | |
2822 | functions. | |
2823 | .Sp | |
2824 | In addition, seriously incorrect code will result if you call a | |
2825 | function with too many arguments. (Normally, extra arguments are | |
2826 | harmlessly ignored.) | |
2827 | .Sp | |
2828 | The \c | |
2829 | .B rtd\c | |
2830 | \& instruction is supported by the 68010 and 68020 | |
2831 | processors, but not by the 68000. | |
2832 | .PP | |
2833 | These `\|\c | |
2834 | .B \-m\c | |
2835 | \&\|' options are defined for the Vax: | |
2836 | .TP | |
2837 | .B \-munix | |
2838 | Do not output certain jump instructions (\c | |
2839 | .B aobleq\c | |
2840 | \& and so on) | |
2841 | that the Unix assembler for the Vax cannot handle across long | |
2842 | ranges. | |
2843 | .TP | |
2844 | .B \-mgnu | |
2845 | Do output those jump instructions, on the assumption that you | |
2846 | will assemble with the GNU assembler. | |
2847 | .TP | |
2848 | .B \-mg | |
2849 | Output code for g-format floating point numbers instead of d-format. | |
2850 | .PP | |
2851 | These `\|\c | |
2852 | .B \-m\c | |
2853 | \&\|' switches are supported on the SPARC: | |
2854 | .PP | |
2855 | .B \-mfpu | |
2856 | .TP | |
2857 | .B \-mhard\-float | |
2858 | Generate output containing floating point instructions. This is the | |
2859 | default. | |
2860 | .PP | |
2861 | .B \-mno\-fpu | |
2862 | .TP | |
2863 | .B \-msoft\-float | |
2864 | Generate output containing library calls for floating point. | |
2865 | .I Warning: | |
2866 | there is no GNU floating-point library for SPARC. | |
2867 | Normally the facilities of the machine's usual C compiler are used, but | |
2868 | this cannot be done directly in cross-compilation. You must make your | |
2869 | own arrangements to provide suitable library functions for | |
2870 | cross-compilation. | |
2871 | .Sp | |
2872 | .B \-msoft\-float | |
2873 | changes the calling convention in the output file; | |
2874 | therefore, it is only useful if you compile | |
2875 | .I all | |
2876 | of a program with this option. | |
2877 | .PP | |
2878 | .B \-mno\-epilogue | |
2879 | .TP | |
2880 | .B \-mepilogue | |
2881 | With | |
2882 | .B \-mepilogue | |
2883 | (the default), the compiler always emits code for | |
2884 | function exit at the end of each function. Any function exit in | |
2885 | the middle of the function (such as a return statement in C) will | |
2886 | generate a jump to the exit code at the end of the function. | |
2887 | .Sp | |
2888 | With | |
2889 | .BR \-mno\-epilogue , | |
2890 | the compiler tries to emit exit code inline at every function exit. | |
2891 | .PP | |
2892 | .B \-mno\-v8 | |
2893 | .TP | |
2894 | .B \-mv8 | |
2895 | .TP | |
2896 | .B \-msparclite | |
2897 | These three options select variations on the SPARC architecture. | |
2898 | .Sp | |
2899 | By default (unless specifically configured for the Fujitsu SPARClite), | |
2900 | GCC generates code for the v7 variant of the SPARC architecture. | |
2901 | .Sp | |
2902 | .B \-mv8 | |
2903 | will give you SPARC v8 code. The only difference from v7 | |
2904 | code is that the compiler emits the integer multiply and integer | |
2905 | divide instructions which exist in SPARC v8 but not in SPARC v7. | |
2906 | .Sp | |
2907 | .B \-msparclite | |
2908 | will give you SPARClite code. This adds the integer | |
2909 | multiply, integer divide step and scan (ffs) instructions which | |
2910 | exist in SPARClite but not in SPARC v7. | |
2911 | .PP | |
2912 | .B \-mcypress | |
2913 | .TP | |
2914 | .B \-msupersparc | |
2915 | These two options select the processor for which the code is optimised. | |
2916 | .Sp | |
2917 | With | |
2918 | .B \-mcypress | |
2919 | (the default), the compiler optimises code for the Cypress CY7C602 chip, as | |
2920 | used in the SparcStation/SparcServer 3xx series. This is also appropriate for | |
2921 | the older SparcStation 1, 2, IPX etc. | |
2922 | .Sp | |
2923 | With | |
2924 | .B \-msupersparc | |
2925 | the compiler optimises code for the SuperSparc cpu, as used in the SparcStation | |
2926 | 10, 1000 and 2000 series. This flag also enables use of the full SPARC v8 | |
2927 | instruction set. | |
2928 | .PP | |
2929 | These `\|\c | |
2930 | .B \-m\c | |
2931 | \&\|' options are defined for the Convex: | |
2932 | .TP | |
2933 | .B \-mc1 | |
2934 | Generate output for a C1. This is the default when the compiler is | |
2935 | configured for a C1. | |
2936 | .TP | |
2937 | .B \-mc2 | |
2938 | Generate output for a C2. This is the default when the compiler is | |
2939 | configured for a C2. | |
2940 | .TP | |
2941 | .B \-margcount | |
2942 | Generate code which puts an argument count in the word preceding each | |
2943 | argument list. Some nonportable Convex and Vax programs need this word. | |
2944 | (Debuggers don't, except for functions with variable-length argument | |
2945 | lists; this info is in the symbol table.) | |
2946 | .TP | |
2947 | .B \-mnoargcount | |
2948 | Omit the argument count word. This is the default if you use the | |
2949 | unmodified sources. | |
2950 | .PP | |
2951 | These `\|\c | |
2952 | .B \-m\c | |
2953 | \&\|' options are defined for the AMD Am29000: | |
2954 | .TP | |
2955 | .B \-mdw | |
2956 | Generate code that assumes the DW bit is set, i.e., that byte and | |
2957 | halfword operations are directly supported by the hardware. This is the | |
2958 | default. | |
2959 | .TP | |
2960 | .B \-mnodw | |
2961 | Generate code that assumes the DW bit is not set. | |
2962 | .TP | |
2963 | .B \-mbw | |
2964 | Generate code that assumes the system supports byte and halfword write | |
2965 | operations. This is the default. | |
2966 | .TP | |
2967 | .B \-mnbw | |
2968 | Generate code that assumes the systems does not support byte and | |
2969 | halfword write operations. This implies `\|\c | |
2970 | .B \-mnodw\c | |
2971 | \&\|'. | |
2972 | .TP | |
2973 | .B \-msmall | |
2974 | Use a small memory model that assumes that all function addresses are | |
2975 | either within a single 256 KB segment or at an absolute address of less | |
2976 | than 256K. This allows the \c | |
2977 | .B call\c | |
2978 | \& instruction to be used instead | |
2979 | of a \c | |
2980 | .B const\c | |
2981 | \&, \c | |
2982 | .B consth\c | |
2983 | \&, \c | |
2984 | .B calli\c | |
2985 | \& sequence. | |
2986 | .TP | |
2987 | .B \-mlarge | |
2988 | Do not assume that the \c | |
2989 | .B call\c | |
2990 | \& instruction can be used; this is the | |
2991 | default. | |
2992 | .TP | |
2993 | .B \-m29050 | |
2994 | Generate code for the Am29050. | |
2995 | .TP | |
2996 | .B \-m29000 | |
2997 | Generate code for the Am29000. This is the default. | |
2998 | .TP | |
2999 | .B \-mkernel\-registers | |
3000 | Generate references to registers \c | |
3001 | .B gr64-gr95\c | |
3002 | \& instead of | |
3003 | .B gr96-gr127\c | |
3004 | \&. This option can be used when compiling kernel code | |
3005 | that wants a set of global registers disjoint from that used by | |
3006 | user-mode code. | |
3007 | .Sp | |
3008 | Note that when this option is used, register names in `\|\c | |
3009 | .B \-f\c | |
3010 | \&\|' flags | |
3011 | must use the normal, user-mode, names. | |
3012 | .TP | |
3013 | .B \-muser\-registers | |
3014 | Use the normal set of global registers, \c | |
3015 | .B gr96-gr127\c | |
3016 | \&. This is the | |
3017 | default. | |
3018 | .TP | |
3019 | .B \-mstack\-check | |
3020 | Insert a call to \c | |
3021 | .B _\|_msp_check\c | |
3022 | \& after each stack adjustment. This | |
3023 | is often used for kernel code. | |
3024 | .PP | |
3025 | These `\|\c | |
3026 | .B \-m\c | |
3027 | \&\|' options are defined for Motorola 88K architectures: | |
3028 | .TP | |
3029 | .B \-m88000 | |
3030 | Generate code that works well on both the m88100 and the | |
3031 | m88110. | |
3032 | .TP | |
3033 | .B \-m88100 | |
3034 | Generate code that works best for the m88100, but that also | |
3035 | runs on the m88110. | |
3036 | .TP | |
3037 | .B \-m88110 | |
3038 | Generate code that works best for the m88110, and may not run | |
3039 | on the m88100. | |
3040 | .TP | |
3041 | .B \-midentify\-revision | |
3042 | Include an \c | |
3043 | .B ident\c | |
3044 | \& directive in the assembler output recording the | |
3045 | source file name, compiler name and version, timestamp, and compilation | |
3046 | flags used. | |
3047 | .TP | |
3048 | .B \-mno\-underscores | |
3049 | In assembler output, emit symbol names without adding an underscore | |
3050 | character at the beginning of each name. The default is to use an | |
3051 | underscore as prefix on each name. | |
3052 | .TP | |
3053 | .B \-mno\-check\-zero\-division | |
3054 | .TP | |
3055 | .B \-mcheck\-zero\-division | |
3056 | Early models of the 88K architecture had problems with division by zero; | |
3057 | in particular, many of them didn't trap. Use these options to avoid | |
3058 | including (or to include explicitly) additional code to detect division | |
3059 | by zero and signal an exception. All GCC configurations for the 88K use | |
3060 | `\|\c | |
3061 | .B \-mcheck\-zero\-division\c | |
3062 | \&\|' by default. | |
3063 | .TP | |
3064 | .B \-mocs\-debug\-info | |
3065 | .TP | |
3066 | .B \-mno\-ocs\-debug\-info | |
3067 | Include (or omit) additional debugging information (about | |
3068 | registers used in each stack frame) as specified in the 88Open Object | |
3069 | Compatibility Standard, \*(lqOCS\*(rq. This extra information is not needed | |
3070 | by GDB. The default for DG/UX, SVr4, and Delta 88 SVr3.2 is to | |
3071 | include this information; other 88k configurations omit this information | |
3072 | by default. | |
3073 | .TP | |
3074 | .B \-mocs\-frame\-position | |
3075 | .TP | |
3076 | .B \-mno\-ocs\-frame\-position | |
3077 | Force (or do not require) register values to be stored in a particular | |
3078 | place in stack frames, as specified in OCS. The DG/UX, Delta88 SVr3.2, | |
3079 | and BCS configurations use `\|\c | |
3080 | .B \-mocs\-frame\-position\c | |
3081 | \&\|'; other 88k | |
3082 | configurations have the default `\|\c | |
3083 | .B \-mno\-ocs\-frame\-position\c | |
3084 | \&\|'. | |
3085 | .TP | |
3086 | .B \-moptimize\-arg\-area | |
3087 | .TP | |
3088 | .B \-mno\-optimize\-arg\-area | |
3089 | Control how to store function arguments in stack frames. | |
3090 | `\|\c | |
3091 | .B \-moptimize\-arg\-area\c | |
3092 | \&\|' saves space, but may break some | |
3093 | debuggers (not GDB). `\|\c | |
3094 | .B \-mno\-optimize\-arg\-area\c | |
3095 | \&\|' conforms better to | |
3096 | standards. By default GCC does not optimize the argument area. | |
3097 | .TP | |
3098 | .BI "\-mshort\-data\-" "num" | |
3099 | .I num | |
3100 | Generate smaller data references by making them relative to \c | |
3101 | .B r0\c | |
3102 | \&, | |
3103 | which allows loading a value using a single instruction (rather than the | |
3104 | usual two). You control which data references are affected by | |
3105 | specifying \c | |
3106 | .I num\c | |
3107 | \& with this option. For example, if you specify | |
3108 | `\|\c | |
3109 | .B \-mshort\-data\-512\c | |
3110 | \&\|', then the data references affected are those | |
3111 | involving displacements of less than 512 bytes. | |
3112 | `\|\c | |
3113 | .B \-mshort\-data\-\c | |
3114 | .I num\c | |
3115 | \&\c | |
3116 | \&\|' is not effective for \c | |
3117 | .I num\c | |
3118 | \& greater | |
3119 | than 64K. | |
3120 | .PP | |
3121 | .B \-mserialize-volatile | |
3122 | .TP | |
3123 | .B \-mno-serialize-volatile | |
3124 | Do, or do not, generate code to guarantee sequential consistency of | |
3125 | volatile memory references. | |
3126 | .Sp | |
3127 | GNU CC always guarantees consistency by default, for the preferred | |
3128 | processor submodel. How this is done depends on the submodel. | |
3129 | .Sp | |
3130 | The m88100 processor does not reorder memory references and so always | |
3131 | provides sequential consistency. If you use `\|\c | |
3132 | .B \-m88100\c | |
3133 | \&\|', GNU CC does | |
3134 | not generate any special instructions for sequential consistency. | |
3135 | .Sp | |
3136 | The order of memory references made by the m88110 processor does not | |
3137 | always match the order of the instructions requesting those references. | |
3138 | In particular, a load instruction may execute before a preceding store | |
3139 | instruction. Such reordering violates sequential consistency of | |
3140 | volatile memory references, when there are multiple processors. When | |
3141 | you use `\|\c | |
3142 | .B \-m88000\c | |
3143 | \&\|' or `\|\c | |
3144 | .B \-m88110\c | |
3145 | \&\|', GNU CC generates special | |
3146 | instructions when appropriate, to force execution in the proper order. | |
3147 | .Sp | |
3148 | The extra code generated to guarantee consistency may affect the | |
3149 | performance of your application. If you know that you can safely forgo | |
3150 | this guarantee, you may use the option `\|\c | |
3151 | .B \-mno-serialize-volatile\c | |
3152 | \&\|'. | |
3153 | .Sp | |
3154 | If you use the `\|\c | |
3155 | .B \-m88100\c | |
3156 | \&\|' option but require sequential consistency | |
3157 | when running on the m88110 processor, you should use | |
3158 | `\|\c | |
3159 | .B \-mserialize-volatile\c | |
3160 | \&\|'. | |
3161 | .PP | |
3162 | .B \-msvr4 | |
3163 | .TP | |
3164 | .B \-msvr3 | |
3165 | Turn on (`\|\c | |
3166 | .B \-msvr4\c | |
3167 | \&\|') or off (`\|\c | |
3168 | .B \-msvr3\c | |
3169 | \&\|') compiler extensions | |
3170 | related to System V release 4 (SVr4). This controls the following: | |
3171 | .TP | |
3172 | \ \ \ \(bu | |
3173 | Which variant of the assembler syntax to emit (which you can select | |
3174 | independently using `\|\c | |
3175 | .B \-mversion\-03.00\c | |
3176 | \&\|'). | |
3177 | .TP | |
3178 | \ \ \ \(bu | |
3179 | `\|\c | |
3180 | .B \-msvr4\c | |
3181 | \&\|' makes the C preprocessor recognize `\|\c | |
3182 | .B #pragma weak\c | |
3183 | \&\|' | |
3184 | .TP | |
3185 | \ \ \ \(bu | |
3186 | `\|\c | |
3187 | .B \-msvr4\c | |
3188 | \&\|' makes GCC issue additional declaration directives used in | |
3189 | SVr4. | |
3190 | .PP | |
3191 | `\|\c | |
3192 | .B \-msvr3\c | |
3193 | \&\|' is the default for all m88K configurations except | |
3194 | the SVr4 configuration. | |
3195 | .TP | |
3196 | .B \-mtrap\-large\-shift | |
3197 | .TP | |
3198 | .B \-mhandle\-large\-shift | |
3199 | Include code to detect bit-shifts of more than 31 bits; respectively, | |
3200 | trap such shifts or emit code to handle them properly. By default GCC | |
3201 | makes no special provision for large bit shifts. | |
3202 | .TP | |
3203 | .B \-muse\-div\-instruction | |
3204 | Very early models of the 88K architecture didn't have a divide | |
3205 | instruction, so GCC avoids that instruction by default. Use this option | |
3206 | to specify that it's safe to use the divide instruction. | |
3207 | .TP | |
3208 | .B \-mversion\-03.00 | |
3209 | In the DG/UX configuration, there are two flavors of SVr4. This option | |
3210 | modifies | |
3211 | .B \-msvr4 | |
3212 | to select whether the hybrid-COFF or real-ELF | |
3213 | flavor is used. All other configurations ignore this option. | |
3214 | .TP | |
3215 | .B \-mwarn\-passed\-structs | |
3216 | Warn when a function passes a struct as an argument or result. | |
3217 | Structure-passing conventions have changed during the evolution of the C | |
3218 | language, and are often the source of portability problems. By default, | |
3219 | GCC issues no such warning. | |
3220 | .PP | |
3221 | These options are defined for the IBM RS6000: | |
3222 | .PP | |
3223 | .B \-mfp\-in\-toc | |
3224 | .TP | |
3225 | .B \-mno\-fp\-in\-toc | |
3226 | Control whether or not floating-point constants go in the Table of | |
3227 | Contents (TOC), a table of all global variable and function addresses. By | |
3228 | default GCC puts floating-point constants there; if the TOC overflows, | |
3229 | `\|\c | |
3230 | .B \-mno\-fp\-in\-toc\c | |
3231 | \&\|' will reduce the size of the TOC, which may avoid | |
3232 | the overflow. | |
3233 | .PP | |
3234 | These `\|\c | |
3235 | .B \-m\c | |
3236 | \&\|' options are defined for the IBM RT PC: | |
3237 | .TP | |
3238 | .B \-min\-line\-mul | |
3239 | Use an in-line code sequence for integer multiplies. This is the | |
3240 | default. | |
3241 | .TP | |
3242 | .B \-mcall\-lib\-mul | |
3243 | Call \c | |
3244 | .B lmul$$\c | |
3245 | \& for integer multiples. | |
3246 | .TP | |
3247 | .B \-mfull\-fp\-blocks | |
3248 | Generate full-size floating point data blocks, including the minimum | |
3249 | amount of scratch space recommended by IBM. This is the default. | |
3250 | .TP | |
3251 | .B \-mminimum\-fp\-blocks | |
3252 | Do not include extra scratch space in floating point data blocks. This | |
3253 | results in smaller code, but slower execution, since scratch space must | |
3254 | be allocated dynamically. | |
3255 | .TP | |
3256 | .B \-mfp\-arg\-in\-fpregs | |
3257 | Use a calling sequence incompatible with the IBM calling convention in | |
3258 | which floating point arguments are passed in floating point registers. | |
3259 | Note that \c | |
3260 | .B varargs.h\c | |
3261 | \& and \c | |
3262 | .B stdargs.h\c | |
3263 | \& will not work with | |
3264 | floating point operands if this option is specified. | |
3265 | .TP | |
3266 | .B \-mfp\-arg\-in\-gregs | |
3267 | Use the normal calling convention for floating point arguments. This is | |
3268 | the default. | |
3269 | .TP | |
3270 | .B \-mhc\-struct\-return | |
3271 | Return structures of more than one word in memory, rather than in a | |
3272 | register. This provides compatibility with the MetaWare HighC (hc) | |
3273 | compiler. Use `\|\c | |
3274 | .B \-fpcc\-struct\-return\c | |
3275 | \&\|' for compatibility with the | |
3276 | Portable C Compiler (pcc). | |
3277 | .TP | |
3278 | .B \-mnohc\-struct\-return | |
3279 | Return some structures of more than one word in registers, when | |
3280 | convenient. This is the default. For compatibility with the | |
3281 | IBM-supplied compilers, use either `\|\c | |
3282 | .B \-fpcc\-struct\-return\c | |
3283 | \&\|' or | |
3284 | `\|\c | |
3285 | .B \-mhc\-struct\-return\c | |
3286 | \&\|'. | |
3287 | .PP | |
3288 | These `\|\c | |
3289 | .B \-m\c | |
3290 | \&\|' options are defined for the MIPS family of computers: | |
3291 | .TP | |
3292 | .BI "\-mcpu=" "cpu-type" | |
3293 | Assume the defaults for the machine type | |
3294 | .I cpu-type | |
3295 | when | |
3296 | scheduling instructions. The default | |
3297 | .I cpu-type | |
3298 | is | |
3299 | .BR default , | |
3300 | which picks the longest cycles times for any of the machines, in order | |
3301 | that the code run at reasonable rates on all MIPS cpu's. Other | |
3302 | choices for | |
3303 | .I cpu-type | |
3304 | are | |
3305 | .BR r2000 , | |
3306 | .BR r3000 , | |
3307 | .BR r4000 , | |
3308 | and | |
3309 | .BR r6000 . | |
3310 | While picking a specific | |
3311 | .I cpu-type | |
3312 | will schedule things appropriately for that particular chip, the | |
3313 | compiler will not generate any code that does not meet level 1 of the | |
3314 | MIPS ISA (instruction set architecture) without the | |
3315 | .B \-mips2 | |
3316 | or | |
3317 | .B \-mips3 | |
3318 | switches being used. | |
3319 | .TP | |
3320 | .B \-mips2 | |
3321 | Issue instructions from level 2 of the MIPS ISA (branch likely, square | |
3322 | root instructions). The | |
3323 | .B \-mcpu=r4000 | |
3324 | or | |
3325 | .B \-mcpu=r6000 | |
3326 | switch must be used in conjunction with | |
3327 | .BR \-mips2 . | |
3328 | .TP | |
3329 | .B \-mips3 | |
3330 | Issue instructions from level 3 of the MIPS ISA (64 bit instructions). | |
3331 | The | |
3332 | .B \-mcpu=r4000 | |
3333 | switch must be used in conjunction with | |
3334 | .BR \-mips2 . | |
3335 | .TP | |
3336 | .B \-mint64 | |
3337 | .TP | |
3338 | .B \-mlong64 | |
3339 | .TP | |
3340 | .B \-mlonglong128 | |
3341 | These options don't work at present. | |
3342 | .TP | |
3343 | .B \-mmips\-as | |
3344 | Generate code for the MIPS assembler, and invoke | |
3345 | .B mips\-tfile | |
3346 | to add normal debug information. This is the default for all | |
3347 | platforms except for the OSF/1 reference platform, using the OSF/rose | |
3348 | object format. If any of the | |
3349 | .BR \-ggdb , | |
3350 | .BR \-gstabs , | |
3351 | or | |
3352 | .B \-gstabs+ | |
3353 | switches are used, the | |
3354 | .B mips\-tfile | |
3355 | program will encapsulate the stabs within MIPS ECOFF. | |
3356 | .TP | |
3357 | .B \-mgas | |
3358 | Generate code for the GNU assembler. This is the default on the OSF/1 | |
3359 | reference platform, using the OSF/rose object format. | |
3360 | .TP | |
3361 | .B \-mrnames | |
3362 | .TP | |
3363 | .B \-mno\-rnames | |
3364 | The | |
3365 | .B \-mrnames | |
3366 | switch says to output code using the MIPS software names for the | |
3367 | registers, instead of the hardware names (ie, | |
3368 | .B a0 | |
3369 | instead of | |
3370 | .BR $4 ). | |
3371 | The GNU assembler does not support the | |
3372 | .B \-mrnames | |
3373 | switch, and the MIPS assembler will be instructed to run the MIPS C | |
3374 | preprocessor over the source file. The | |
3375 | .B \-mno\-rnames | |
3376 | switch is default. | |
3377 | .TP | |
3378 | .B \-mgpopt | |
3379 | .TP | |
3380 | .B \-mno\-gpopt | |
3381 | The | |
3382 | .B \-mgpopt | |
3383 | switch says to write all of the data declarations before the | |
3384 | instructions in the text section, to all the MIPS assembler to | |
3385 | generate one word memory references instead of using two words for | |
3386 | short global or static data items. This is on by default if | |
3387 | optimization is selected. | |
3388 | .TP | |
3389 | .B \-mstats | |
3390 | .TP | |
3391 | .B \-mno\-stats | |
3392 | For each non-inline function processed, the | |
3393 | .B \-mstats | |
3394 | switch causes the compiler to emit one line to the standard error file | |
3395 | to print statistics about the program (number of registers saved, | |
3396 | stack size, etc.). | |
3397 | .TP | |
3398 | .B \-mmemcpy | |
3399 | .TP | |
3400 | .B \-mno\-memcpy | |
3401 | The | |
3402 | .B \-mmemcpy | |
3403 | switch makes all block moves call the appropriate string function | |
3404 | .RB ( memcpy | |
3405 | or | |
3406 | .BR bcopy ) | |
3407 | instead of possibly generating inline code. | |
3408 | .TP | |
3409 | .B \-mmips\-tfile | |
3410 | .TP | |
3411 | .B \-mno\-mips\-tfile | |
3412 | The | |
3413 | .B \-mno\-mips\-tfile | |
3414 | switch causes the compiler not postprocess the object file with the | |
3415 | .B mips\-tfile | |
3416 | program, after the MIPS assembler has generated it to add debug | |
3417 | support. If | |
3418 | .B mips\-tfile | |
3419 | is not run, then no local variables will be available to the debugger. | |
3420 | In addition, | |
3421 | .B stage2 | |
3422 | and | |
3423 | .B stage3 | |
3424 | objects will have the temporary file names passed to the assembler | |
3425 | embedded in the object file, which means the objects will not compare | |
3426 | the same. | |
3427 | .TP | |
3428 | .B \-msoft\-float | |
3429 | Generate output containing library calls for floating point. | |
3430 | .I | |
3431 | WARNING: | |
3432 | the requisite libraries are not part of GNU CC. Normally the | |
3433 | facilities of the machine's usual C compiler are used, but this can't | |
3434 | be done directly in cross-compilation. You must make your own | |
3435 | arrangements to provide suitable library functions for cross-compilation. | |
3436 | .TP | |
3437 | .B \-mhard\-float | |
3438 | Generate output containing floating point instructions. This is the | |
3439 | default if you use the unmodified sources. | |
3440 | .TP | |
3441 | .B \-mfp64 | |
3442 | Assume that the | |
3443 | .B FR | |
3444 | bit in the status word is on, and that there are 32 64-bit floating | |
3445 | point registers, instead of 32 32-bit floating point registers. You | |
3446 | must also specify the | |
3447 | .B \-mcpu=r4000 | |
3448 | and | |
3449 | .B \-mips3 | |
3450 | switches. | |
3451 | .TP | |
3452 | .B \-mfp32 | |
3453 | Assume that there are 32 32-bit floating point registers. This is the | |
3454 | default. | |
3455 | .PP | |
3456 | .B \-mabicalls | |
3457 | .TP | |
3458 | .B \-mno\-abicalls | |
3459 | Emit (or do not emit) the | |
3460 | .BR \&.abicalls , | |
3461 | .BR \&.cpload , | |
3462 | and | |
3463 | .B \&.cprestore | |
3464 | pseudo operations that some System V.4 ports use for position | |
3465 | independent code. | |
3466 | .TP | |
3467 | .B \-mhalf\-pic | |
3468 | .TP | |
3469 | .B \-mno\-half\-pic | |
3470 | The | |
3471 | .B \-mhalf\-pic | |
3472 | switch says to put pointers to extern references into the data section | |
3473 | and load them up, rather than put the references in the text section. | |
3474 | This option does not work at present. | |
3475 | .B | |
3476 | .BI \-G num | |
3477 | Put global and static items less than or equal to | |
3478 | .I num | |
3479 | bytes into the small data or bss sections instead of the normal data | |
3480 | or bss section. This allows the assembler to emit one word memory | |
3481 | reference instructions based on the global pointer | |
3482 | .RB ( gp | |
3483 | or | |
3484 | .BR $28 ), | |
3485 | instead of the normal two words used. By default, | |
3486 | .I num | |
3487 | is 8 when the MIPS assembler is used, and 0 when the GNU | |
3488 | assembler is used. The | |
3489 | .BI \-G num | |
3490 | switch is also passed to the assembler and linker. All modules should | |
3491 | be compiled with the same | |
3492 | .BI \-G num | |
3493 | value. | |
3494 | .TP | |
3495 | .B \-nocpp | |
9ec36da5 | 3496 | Tell the MIPS assembler to not run its preprocessor over user |
861bb6c1 JL |
3497 | assembler files (with a `\|\c |
3498 | .B .s\c | |
3499 | \&\|' suffix) when assembling them. | |
3500 | .PP | |
3501 | These `\|\c | |
3502 | .B \-m\c | |
3503 | \&\|' options are defined for the Intel 80386 family of computers: | |
99e0c103 | 3504 | .TP |
861bb6c1 JL |
3505 | .B \-m486 |
3506 | .TP | |
3507 | .B \-mno\-486 | |
3508 | Control whether or not code is optimized for a 486 instead of an | |
3509 | 386. Code generated for a 486 will run on a 386 and vice versa. | |
3510 | .TP | |
3511 | .B \-msoft\-float | |
3512 | Generate output containing library calls for floating point. | |
3513 | .I Warning: | |
3514 | the requisite libraries are not part of GNU CC. | |
3515 | Normally the facilities of the machine's usual C compiler are used, but | |
3516 | this can't be done directly in cross-compilation. You must make your | |
3517 | own arrangements to provide suitable library functions for | |
3518 | cross-compilation. | |
3519 | .Sp | |
3520 | On machines where a function returns floating point results in the 80387 | |
3521 | register stack, some floating point opcodes may be emitted even if | |
3522 | `\|\c | |
3523 | .B \-msoft-float\c | |
3524 | \&\|' is used. | |
3525 | .TP | |
3526 | .B \-mno-fp-ret-in-387 | |
3527 | Do not use the FPU registers for return values of functions. | |
3528 | .Sp | |
3529 | The usual calling convention has functions return values of types | |
3530 | .B float\c | |
3531 | \& and \c | |
3532 | .B double\c | |
3533 | \& in an FPU register, even if there | |
3534 | is no FPU. The idea is that the operating system should emulate | |
3535 | an FPU. | |
3536 | .Sp | |
3537 | The option `\|\c | |
3538 | .B \-mno-fp-ret-in-387\c | |
3539 | \&\|' causes such values to be returned | |
3540 | in ordinary CPU registers instead. | |
3541 | .PP | |
3542 | These `\|\c | |
3543 | .B \-m\c | |
3544 | \&\|' options are defined for the HPPA family of computers: | |
3545 | .TP | |
3546 | .B \-mpa-risc-1-0 | |
3547 | Generate code for a PA 1.0 processor. | |
3548 | .TP | |
3549 | .B \-mpa-risc-1-1 | |
3550 | Generate code for a PA 1.1 processor. | |
3551 | .TP | |
3552 | .B \-mkernel | |
3553 | Generate code which is suitable for use in kernels. Specifically, avoid | |
3554 | .B add\c | |
3555 | \& instructions in which one of the arguments is the DP register; | |
3556 | generate \c | |
3557 | .B addil\c | |
3558 | \& instructions instead. This avoids a rather serious | |
3559 | bug in the HP-UX linker. | |
3560 | .TP | |
861bb6c1 JL |
3561 | .B \-mlong-calls |
3562 | Generate code which allows calls to functions greater than 256K away from | |
3563 | the caller when the caller and callee are in the same source file. Do | |
3564 | not turn this option on unless code refuses to link with \*(lqbranch out of | |
3565 | range errors\*('' from the linker. | |
3566 | .TP | |
3567 | .B \-mdisable-fpregs | |
3568 | Prevent floating point registers from being used in any manner. This is | |
3569 | necessary for compiling kernels which perform lazy context switching of | |
3570 | floating point registers. If you use this option and attempt to perform | |
3571 | floating point operations, the compiler will abort. | |
3572 | .TP | |
3573 | .B \-mdisable-indexing | |
3574 | Prevent the compiler from using indexing address modes. This avoids some | |
3575 | rather obscure problems when compiling MIG generated code under MACH. | |
3576 | .TP | |
3577 | .B \-mtrailing-colon | |
3578 | Add a colon to the end of label definitions (for ELF assemblers). | |
3579 | .PP | |
3580 | These `\|\c | |
3581 | .B \-m\c | |
3582 | \&\|' options are defined for the Intel 80960 family of computers: | |
3583 | .TP | |
3584 | .BI "\-m" "cpu-type" | |
3585 | Assume the defaults for the machine type | |
3586 | .I cpu-type | |
3587 | for instruction and addressing-mode availability and alignment. | |
3588 | The default | |
3589 | .I cpu-type | |
3590 | is | |
3591 | .BR kb ; | |
3592 | other choices are | |
3593 | .BR ka , | |
3594 | .BR mc , | |
3595 | .BR ca , | |
3596 | .BR cf , | |
3597 | .BR sa , | |
3598 | and | |
3599 | .BR sb . | |
3600 | .TP | |
3601 | .B \-mnumerics | |
3602 | .TP | |
3603 | .B \-msoft\-float | |
3604 | The | |
3605 | .B \-mnumerics | |
3606 | option indicates that the processor does support | |
3607 | floating-point instructions. The | |
3608 | .B \-msoft\-float | |
3609 | option indicates | |
3610 | that floating-point support should not be assumed. | |
3611 | .TP | |
3612 | .B \-mleaf\-procedures | |
3613 | .TP | |
3614 | .B \-mno\-leaf\-procedures | |
3615 | Do (or do not) attempt to alter leaf procedures to be callable with the | |
3616 | .I bal | |
3617 | instruction as well as | |
3618 | .IR call . | |
3619 | This will result in more | |
3620 | efficient code for explicit calls when the | |
3621 | .I bal | |
3622 | instruction can be | |
3623 | substituted by the assembler or linker, but less efficient code in other | |
3624 | cases, such as calls via function pointers, or using a linker that doesn't | |
3625 | support this optimization. | |
3626 | .TP | |
3627 | .B \-mtail\-call | |
3628 | .TP | |
3629 | .B \-mno\-tail\-call | |
3630 | Do (or do not) make additional attempts (beyond those of the | |
3631 | machine-independent portions of the compiler) to optimize tail-recursive | |
3632 | calls into branches. You may not want to do this because the detection of | |
3633 | cases where this is not valid is not totally complete. The default is | |
3634 | .BR \-mno\-tail\-call . | |
3635 | .TP | |
3636 | .B \-mcomplex\-addr | |
3637 | .TP | |
3638 | .B \-mno\-complex\-addr | |
3639 | Assume (or do not assume) that the use of a complex addressing mode is a | |
3640 | win on this implementation of the i960. Complex addressing modes may not | |
3641 | be worthwhile on the K-series, but they definitely are on the C-series. | |
3642 | The default is currently | |
3643 | .B \-mcomplex\-addr | |
3644 | for all processors except | |
3645 | the CB and CC. | |
3646 | .TP | |
3647 | .B \-mcode\-align | |
3648 | .TP | |
3649 | .B \-mno\-code\-align | |
3650 | Align code to 8-byte boundaries for faster fetching (or don't bother). | |
3651 | Currently turned on by default for C-series implementations only. | |
3652 | .TP | |
3653 | .B \-mic\-compat | |
3654 | .TP | |
3655 | .B \-mic2.0\-compat | |
3656 | .TP | |
3657 | .B \-mic3.0\-compat | |
3658 | Enable compatibility with iC960 v2.0 or v3.0. | |
3659 | .TP | |
3660 | .B \-masm\-compat | |
3661 | .TP | |
3662 | .B \-mintel\-asm | |
3663 | Enable compatibility with the iC960 assembler. | |
3664 | .TP | |
3665 | .B \-mstrict\-align | |
3666 | .TP | |
3667 | .B \-mno\-strict\-align | |
3668 | Do not permit (do permit) unaligned accesses. | |
3669 | .TP | |
3670 | .B \-mold\-align | |
3671 | Enable structure-alignment compatibility with Intel's gcc release version | |
3672 | 1.3 (based on gcc 1.37). Currently this is buggy in that | |
3673 | .B #pragma align 1 | |
3674 | is always assumed as well, and cannot be turned off. | |
3675 | .PP | |
3676 | These `\|\c | |
3677 | .B \-m\c | |
3678 | \&\|' options are defined for the DEC Alpha implementations: | |
3679 | .TP | |
3680 | .B \-mno-soft-float | |
3681 | .TP | |
3682 | .B \-msoft-float | |
3683 | Use (do not use) the hardware floating-point instructions for | |
3684 | floating-point operations. When \c | |
3685 | .B \-msoft-float\c | |
3686 | \& is specified, | |
3687 | functions in `\|\c | |
3688 | .B libgcc1.c\c | |
3689 | \&\|' will be used to perform floating-point | |
3690 | operations. Unless they are replaced by routines that emulate the | |
3691 | floating-point operations, or compiled in such a way as to call such | |
3692 | emulations routines, these routines will issue floating-point | |
3693 | operations. If you are compiling for an Alpha without floating-point | |
3694 | operations, you must ensure that the library is built so as not to call | |
3695 | them. | |
3696 | .Sp | |
3697 | Note that Alpha implementations without floating-point operations are | |
3698 | required to have floating-point registers. | |
3699 | .TP | |
3700 | .B \-mfp-reg | |
3701 | .TP | |
3702 | .B \-mno-fp-regs | |
3703 | Generate code that uses (does not use) the floating-point register set. | |
3704 | .B \-mno-fp-regs\c | |
3705 | \& implies \c | |
3706 | .B \-msoft-float\c | |
3707 | \&. If the floating-point | |
3708 | register set is not used, floating point operands are passed in integer | |
3709 | registers as if they were integers and floating-point results are passed | |
3710 | in $0 instead of $f0. This is a non-standard calling sequence, so any | |
3711 | function with a floating-point argument or return value called by code | |
3712 | compiled with \c | |
3713 | .B \-mno-fp-regs\c | |
3714 | \& must also be compiled with that | |
3715 | option. | |
3716 | .Sp | |
3717 | A typical use of this option is building a kernel that does not use, | |
3718 | and hence need not save and restore, any floating-point registers. | |
3719 | .PP | |
3720 | These additional options are available on System V Release 4 for | |
3721 | compatibility with other compilers on those systems: | |
3722 | .TP | |
3723 | .B \-G | |
3724 | On SVr4 systems, \c | |
3725 | .B gcc\c | |
3726 | \& accepts the option `\|\c | |
3727 | .B \-G\c | |
3728 | \&\|' (and passes | |
3729 | it to the system linker), for compatibility with other compilers. | |
3730 | However, we suggest you use `\|\c | |
3731 | .B \-symbolic\c | |
3732 | \&\|' or `\|\c | |
3733 | .B \-shared\c | |
3734 | \&\|' as | |
3735 | appropriate, instead of supplying linker options on the \c | |
3736 | .B gcc | |
3737 | command line. | |
3738 | .TP | |
3739 | .B \-Qy | |
3740 | Identify the versions of each tool used by the compiler, in a | |
3741 | .B .ident\c | |
3742 | \& assembler directive in the output. | |
3743 | .TP | |
3744 | .B \-Qn | |
3745 | Refrain from adding \c | |
3746 | .B .ident\c | |
3747 | \& directives to the output file (this is | |
3748 | the default). | |
3749 | .TP | |
3750 | .BI "\-YP," "dirs" | |
3751 | Search the directories \c | |
3752 | .I dirs\c | |
3753 | \&, and no others, for libraries | |
3754 | specified with `\|\c | |
3755 | .B \-l\c | |
3756 | \&\|'. You can separate directory entries in | |
3757 | .I dirs\c | |
3758 | \& from one another with colons. | |
3759 | .TP | |
3760 | .BI "\-Ym," "dir" | |
3761 | Look in the directory \c | |
3762 | .I dir\c | |
3763 | \& to find the M4 preprocessor. | |
3764 | The assembler uses this option. | |
3765 | .SH CODE GENERATION OPTIONS | |
3766 | These machine-independent options control the interface conventions | |
3767 | used in code generation. | |
3768 | .PP | |
3769 | Most of them begin with `\|\c | |
3770 | \-f\c | |
3771 | \&\|'. These options have both positive and negative forms; the negative form | |
3772 | of `\|\c | |
3773 | .B \-ffoo\c | |
3774 | \&\|' would be `\|\c | |
3775 | .B \-fno\-foo\c | |
3776 | \&\|'. In the table below, only | |
3777 | one of the forms is listed\(em\&the one which is not the default. You | |
3778 | can figure out the other form by either removing `\|\c | |
3779 | .B no\-\c | |
3780 | \&\|' or adding | |
3781 | it. | |
3782 | .TP | |
3783 | .B \-fnonnull\-objects | |
3784 | Assume that objects reached through references are not null | |
3785 | (C++ only). | |
3786 | .Sp | |
3787 | Normally, GNU C++ makes conservative assumptions about objects reached | |
3788 | through references. For example, the compiler must check that \c | |
3789 | .B a | |
3790 | is not null in code like the following: | |
3791 | .Sp | |
3792 | obj &a = g (); | |
3793 | a.f (2); | |
3794 | .Sp | |
3795 | Checking that references of this sort have non-null values requires | |
3796 | extra code, however, and it is unnecessary for many programs. You can | |
3797 | use `\|\c | |
3798 | .B \-fnonnull-objects\c | |
3799 | \&\|' to omit the checks for null, if your | |
3800 | program doesn't require checking. | |
3801 | .TP | |
3802 | .B \-fpcc\-struct\-return | |
3803 | Use the same convention for returning \c | |
3804 | .B struct\c | |
3805 | \& and \c | |
3806 | .B union | |
3807 | values that is used by the usual C compiler on your system. This | |
3808 | convention is less efficient for small structures, and on many | |
3809 | machines it fails to be reentrant; but it has the advantage of | |
3810 | allowing intercallability between GCC-compiled code and PCC-compiled | |
3811 | code. | |
3812 | .TP | |
3813 | .B \-freg\-struct\-return | |
3814 | Use the convention that | |
3815 | .B struct | |
3816 | and | |
3817 | .B union | |
3818 | values are returned in registers when possible. This is more | |
3819 | efficient for small structures than | |
3820 | .BR \-fpcc\-struct\-return . | |
3821 | .Sp | |
3822 | If you specify neither | |
3823 | .B \-fpcc\-struct\-return | |
3824 | nor | |
3825 | .BR \-freg\-struct\-return , | |
3826 | GNU CC defaults to whichever convention is standard for the target. | |
3827 | If there is no standard convention, GNU CC defaults to | |
3828 | .BR \-fpcc\-struct\-return . | |
3829 | .TP | |
3830 | .B \-fshort\-enums | |
3831 | Allocate to an \c | |
3832 | .B enum\c | |
3833 | \& type only as many bytes as it needs for the | |
3834 | declared range of possible values. Specifically, the \c | |
3835 | .B enum\c | |
3836 | \& type | |
3837 | will be equivalent to the smallest integer type which has enough room. | |
3838 | .TP | |
3839 | .B \-fshort\-double | |
3840 | Use the same size for | |
3841 | .B double | |
3842 | as for | |
3843 | .B float | |
3844 | \&. | |
3845 | .TP | |
3846 | .B \-fshared\-data | |
3847 | Requests that the data and non-\c | |
3848 | .B const\c | |
3849 | \& variables of this | |
3850 | compilation be shared data rather than private data. The distinction | |
3851 | makes sense only on certain operating systems, where shared data is | |
3852 | shared between processes running the same program, while private data | |
3853 | exists in one copy per process. | |
3854 | .TP | |
3855 | .B \-fno\-common | |
3856 | Allocate even uninitialized global variables in the bss section of the | |
3857 | object file, rather than generating them as common blocks. This has the | |
3858 | effect that if the same variable is declared (without \c | |
3859 | .B extern\c | |
3860 | \&) in | |
3861 | two different compilations, you will get an error when you link them. | |
3862 | The only reason this might be useful is if you wish to verify that the | |
3863 | program will work on other systems which always work this way. | |
3864 | .TP | |
3865 | .B \-fno\-ident | |
3866 | Ignore the `\|\c | |
3867 | .B #ident\c | |
3868 | \&\|' directive. | |
3869 | .TP | |
3870 | .B \-fno\-gnu\-linker | |
3871 | Do not output global initializations (such as C++ constructors and | |
3872 | destructors) in the form used by the GNU linker (on systems where the GNU | |
3873 | linker is the standard method of handling them). Use this option when | |
3874 | you want to use a non-GNU linker, which also requires using the | |
3875 | .B collect2\c | |
3876 | \& program to make sure the system linker includes | |
3877 | constructors and destructors. (\c | |
3878 | .B collect2\c | |
3879 | \& is included in the GNU CC | |
3880 | distribution.) For systems which \c | |
3881 | .I must\c | |
3882 | \& use \c | |
3883 | .B collect2\c | |
3884 | \&, the | |
3885 | compiler driver \c | |
3886 | .B gcc\c | |
3887 | \& is configured to do this automatically. | |
3888 | .TP | |
3889 | .B \-finhibit-size-directive | |
3890 | Don't output a \c | |
3891 | .B .size\c | |
3892 | \& assembler directive, or anything else that | |
3893 | would cause trouble if the function is split in the middle, and the | |
3894 | two halves are placed at locations far apart in memory. This option is | |
3895 | used when compiling `\|\c | |
3896 | .B crtstuff.c\c | |
3897 | \&\|'; you should not need to use it | |
3898 | for anything else. | |
3899 | .TP | |
3900 | .B \-fverbose-asm | |
3901 | Put extra commentary information in the generated assembly code to | |
3902 | make it more readable. This option is generally only of use to those | |
3903 | who actually need to read the generated assembly code (perhaps while | |
3904 | debugging the compiler itself). | |
3905 | .TP | |
3906 | .B \-fvolatile | |
3907 | Consider all memory references through pointers to be volatile. | |
3908 | .TP | |
3909 | .B \-fvolatile\-global | |
3910 | Consider all memory references to extern and global data items to | |
3911 | be volatile. | |
3912 | .TP | |
3913 | .B \-fpic | |
3914 | If supported for the target machines, generate position-independent code, | |
3915 | suitable for use in a shared library. | |
3916 | .TP | |
3917 | .B \-fPIC | |
3918 | If supported for the target machine, emit position-independent code, | |
3919 | suitable for dynamic linking, even if branches need large displacements. | |
3920 | .TP | |
3921 | .BI "\-ffixed\-" "reg" | |
3922 | Treat the register named \c | |
3923 | .I reg\c | |
3924 | \& as a fixed register; generated code | |
3925 | should never refer to it (except perhaps as a stack pointer, frame | |
3926 | pointer or in some other fixed role). | |
3927 | .Sp | |
3928 | .I reg\c | |
3929 | \& must be the name of a register. The register names accepted | |
3930 | are machine-specific and are defined in the \c | |
3931 | .B REGISTER_NAMES | |
3932 | macro in the machine description macro file. | |
3933 | .Sp | |
3934 | This flag does not have a negative form, because it specifies a | |
3935 | three-way choice. | |
3936 | .TP | |
3937 | .BI "\-fcall\-used\-" "reg" | |
3938 | Treat the register named \c | |
3939 | .I reg\c | |
956d6950 | 3940 | \& as an allocable register that is |
861bb6c1 JL |
3941 | clobbered by function calls. It may be allocated for temporaries or |
3942 | variables that do not live across a call. Functions compiled this way | |
3943 | will not save and restore the register \c | |
3944 | .I reg\c | |
3945 | \&. | |
3946 | .Sp | |
3947 | Use of this flag for a register that has a fixed pervasive role in the | |
3948 | machine's execution model, such as the stack pointer or frame pointer, | |
3949 | will produce disastrous results. | |
3950 | .Sp | |
3951 | This flag does not have a negative form, because it specifies a | |
3952 | three-way choice. | |
3953 | .TP | |
3954 | .BI "\-fcall\-saved\-" "reg" | |
3955 | Treat the register named \c | |
3956 | .I reg\c | |
956d6950 | 3957 | \& as an allocable register saved by |
861bb6c1 JL |
3958 | functions. It may be allocated even for temporaries or variables that |
3959 | live across a call. Functions compiled this way will save and restore | |
3960 | the register \c | |
3961 | .I reg\c | |
3962 | \& if they use it. | |
3963 | .Sp | |
3964 | Use of this flag for a register that has a fixed pervasive role in the | |
3965 | machine's execution model, such as the stack pointer or frame pointer, | |
3966 | will produce disastrous results. | |
3967 | .Sp | |
3968 | A different sort of disaster will result from the use of this flag for | |
3969 | a register in which function values may be returned. | |
3970 | .Sp | |
3971 | This flag does not have a negative form, because it specifies a | |
3972 | three-way choice. | |
3973 | .SH PRAGMAS | |
3974 | Two `\|\c | |
3975 | .B #pragma\c | |
3976 | \&\|' directives are supported for GNU C++, to permit using the same | |
3977 | header file for two purposes: as a definition of interfaces to a given | |
3978 | object class, and as the full definition of the contents of that object class. | |
3979 | .TP | |
3980 | .B #pragma interface | |
3981 | (C++ only.) | |
3982 | Use this directive in header files that define object classes, to save | |
3983 | space in most of the object files that use those classes. Normally, | |
3984 | local copies of certain information (backup copies of inline member | |
3985 | functions, debugging information, and the internal tables that | |
3986 | implement virtual functions) must be kept in each object file that | |
3987 | includes class definitions. You can use this pragma to avoid such | |
3988 | duplication. When a header file containing `\|\c | |
3989 | .B #pragma interface\c | |
3990 | \&\|' is included in a compilation, this auxiliary information | |
3991 | will not be generated (unless the main input source file itself uses | |
3992 | `\|\c | |
3993 | .B #pragma implementation\c | |
3994 | \&\|'). Instead, the object files will contain references to be | |
3995 | resolved at link time. | |
3996 | .TP | |
3997 | .B #pragma implementation | |
3998 | .TP | |
3999 | \fB#pragma implementation "\fP\fIobjects\fP\fB.h"\fP | |
4000 | (C++ only.) | |
4001 | Use this pragma in a main input file, when you want full output from | |
4002 | included header files to be generated (and made globally visible). | |
4003 | The included header file, in turn, should use `\|\c | |
4004 | .B #pragma interface\c | |
4005 | \&\|'. | |
4006 | Backup copies of inline member functions, debugging information, and | |
4007 | the internal tables used to implement virtual functions are all | |
4008 | generated in implementation files. | |
4009 | .Sp | |
4010 | If you use `\|\c | |
4011 | .B #pragma implementation\c | |
4012 | \&\|' with no argument, it applies to an include file with the same | |
4013 | basename as your source file; for example, in `\|\c | |
4014 | .B allclass.cc\c | |
4015 | \&\|', `\|\c | |
4016 | .B #pragma implementation\c | |
4017 | \&\|' by itself is equivalent to `\|\c | |
4018 | .B | |
4019 | #pragma implementation "allclass.h"\c | |
4020 | \&\|'. Use the string argument if you want a single implementation | |
4021 | file to include code from multiple header files. | |
4022 | .Sp | |
4023 | There is no way to split up the contents of a single header file into | |
4024 | multiple implementation files. | |
4025 | .SH FILES | |
4026 | .nf | |
4027 | .ta \w'LIBDIR/g++\-include 'u | |
4028 | file.c C source file | |
4029 | file.h C header (preprocessor) file | |
4030 | file.i preprocessed C source file | |
4031 | file.C C++ source file | |
4032 | file.cc C++ source file | |
4033 | file.cxx C++ source file | |
4034 | file.m Objective-C source file | |
4035 | file.s assembly language file | |
4036 | file.o object file | |
4037 | a.out link edited output | |
4038 | \fITMPDIR\fR/cc\(** temporary files | |
4039 | \fILIBDIR\fR/cpp preprocessor | |
4040 | \fILIBDIR\fR/cc1 compiler for C | |
4041 | \fILIBDIR\fR/cc1plus compiler for C++ | |
4042 | \fILIBDIR\fR/collect linker front end needed on some machines | |
4043 | \fILIBDIR\fR/libgcc.a GCC subroutine library | |
4044 | /lib/crt[01n].o start-up routine | |
4045 | \fILIBDIR\fR/ccrt0 additional start-up routine for C++ | |
4046 | /lib/libc.a standard C library, see | |
4047 | .IR intro (3) | |
4048 | /usr/include standard directory for \fB#include\fP files | |
4049 | \fILIBDIR\fR/include standard gcc directory for \fB#include\fP files | |
4050 | \fILIBDIR\fR/g++\-include additional g++ directory for \fB#include\fP | |
4051 | .Sp | |
4052 | .fi | |
4053 | .I LIBDIR | |
4054 | is usually | |
4055 | .B /usr/local/lib/\c | |
4056 | .IR machine / version . | |
4057 | .br | |
4058 | .I TMPDIR | |
4059 | comes from the environment variable | |
4060 | .B TMPDIR | |
4061 | (default | |
4062 | .B /usr/tmp | |
4063 | if available, else | |
4064 | .B /tmp\c | |
4065 | \&). | |
84221183 MK |
4066 | .SH "EXIT STATUS" |
4067 | Normally the exit status is 0, if compilation or link edit are successful, | |
4068 | and nonzero else. The option | |
4069 | .B -Werror | |
4070 | treats each warning as an error. | |
861bb6c1 JL |
4071 | .SH "SEE ALSO" |
4072 | cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1). | |
4073 | .br | |
4074 | .RB "`\|" gcc "\|', `\|" cpp \|', | |
4075 | .RB "`\|" as "\|', `\|" ld \|', | |
4076 | and | |
4077 | .RB `\| gdb \|' | |
4078 | entries in | |
4079 | .B info\c | |
4080 | \&. | |
4081 | .br | |
4082 | .I | |
4083 | Using and Porting GNU CC (for version 2.0)\c | |
4084 | , Richard M. Stallman; | |
4085 | .I | |
4086 | The C Preprocessor\c | |
4087 | , Richard M. Stallman; | |
4088 | .I | |
4089 | Debugging with GDB: the GNU Source-Level Debugger\c | |
4090 | , Richard M. Stallman and Roland H. Pesch; | |
4091 | .I | |
4092 | Using as: the GNU Assembler\c | |
4093 | , Dean Elsner, Jay Fenlason & friends; | |
4094 | .I | |
4095 | ld: the GNU linker\c | |
4096 | , Steve Chamberlain and Roland Pesch. | |
4097 | .SH BUGS | |
4098 | For instructions on reporting bugs, see the GCC manual. | |
4099 | .SH COPYING | |
4100 | Copyright | |
4101 | .if t \(co | |
4102 | 1991, 1992, 1993 Free Software Foundation, Inc. | |
4103 | .PP | |
4104 | Permission is granted to make and distribute verbatim copies of | |
4105 | this manual provided the copyright notice and this permission notice | |
4106 | are preserved on all copies. | |
4107 | .PP | |
4108 | Permission is granted to copy and distribute modified versions of this | |
4109 | manual under the conditions for verbatim copying, provided that the | |
4110 | entire resulting derived work is distributed under the terms of a | |
4111 | permission notice identical to this one. | |
4112 | .PP | |
4113 | Permission is granted to copy and distribute translations of this | |
4114 | manual into another language, under the above conditions for modified | |
4115 | versions, except that this permission notice may be included in | |
4116 | translations approved by the Free Software Foundation instead of in | |
4117 | the original English. | |
4118 | .SH AUTHORS | |
4119 | See the GNU CC Manual for the contributors to GNU CC. |