-
Notifications
You must be signed in to change notification settings - Fork 16
/
comopts.html
2892 lines (2835 loc) · 164 KB
/
comopts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>GCC Command-Line Options</TITLE>
<STYLE TYPE="TEXT/CSS">
<!--
.IE3-DUMMY { CONT-SIZE: 100%; }
BODY { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #E0E0E0; }
P { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H1 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H2 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H3 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H4 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H5 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
H6 { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
UL { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; }
TD { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #FFFFFF; }
.NOBORDER { BACKGROUND-COLOR: #E0E0E0; PADDING: 0pt; }
.NOBORDER TD { FONT-FAMILY: Verdana,Arial,Helvetica,Sans-Serif; BACKGROUND-COLOR: #E0E0E0; PADDING: 0pt; }
.CODE { FONT-FAMILY: Courier New; }
-->
</STYLE>
</HEAD>
<BODY TEXT="#000000" BGCOLOR="#E0E0E0">
<FONT SIZE="5"><B>GCC Command-Line Options</B></FONT>
<HR>
<P>This part of the documentation is a modified version of the
<A HREF="http://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html">Command-Line Options</A>
section of the <A HREF="http://gcc.gnu.org/onlinedocs/gcc/">GCC Manual</A>.
Therefore it is licensed under the
<A HREF="gnugpl.html#gnufdl">GNU Free Documentation License</A>.
<BR><BR>
This section describes the options supported by <CODE>gcc</CODE>,
the driver program of the GNU Compiler Collection, whose C compiler
and assembler are used here. This program is called either by
<CODE>tigcc</CODE> or by the IDE. <CODE>tigcc</CODE>
simulates some of these options itself, namely <B>'-E'</B>,
<B>'-S'</B>, and <B>'-c'</B>, and it also has some additional ones.
In the IDE, there is an item in the project settings where you can
set the options described here, with some exceptions, including the
switches mentioned above.
<BR><BR>
GCC4TI normally does preprocessing, compilation, assembly and linking
all in one step, and finally produces a file which is executable on
the calculator. The "overall options" allow you to stop this
process at an intermediate stage. For example, the <B>'-c'</B> option
says not to run the linker. Then the output consists of object files
output by the assembler.
<BR><BR>
Other options are passed on to one stage of processing. Some options
control the preprocessor and others the compiler itself. Yet other
options control the assembler and linker; most of these are not
documented here, since you rarely need to use any of them.
In fact, only those options which may be more or less useful with GCC4TI
are mentioned here (although we didn't check whether all of them are
really usable in GCC4TI). For more info about standard options that are
recognized by the compiler, read the
<A HREF="http://gcc.gnu.org/onlinedocs/gcc/Invoking-GCC.html">official manual</A>.
<BR><BR>
We suggest that you use the <B>'-O2'</B> switch in all of your
compilations; it increases speed and decreases the program size at the
cost of compilation time.
<BR><BR>
<CODE>tigcc</CODE> accepts options and file names as operands. Many
options have multi-letter names; therefore multiple single-letter options
may <I>not</I> be grouped: <B>'-dr'</B> is very different from <B>'-d
-r'</B>.
<BR><BR>
You can mix options and other arguments. For the most part, the order
you use doesn't matter. Order does matter when you use several options
of the same kind; for example, if you specify <B>'-L'</B> more than once,
the directories are searched in the order specified.
<BR><BR>
Many options have long names starting with <B>'-f'</B> or with
<B>'-W'</B> - for example, <B>'-fforce-mem'</B>,
<B>'-fstrength-reduce'</B>, <B>'-Wformat'</B> and so on. Most of
these have both positive and negative forms; the negative form of
<B>'-ffoo'</B> would be <B>'-fno-foo'</B>. This manual documents
only one of these two forms, whichever one is not the default.</P>
<UL>
<LI><B><A HREF="#SEC3">Options Available in the Command Line Compiler</A></B>
<LI><B><A HREF="#SEC4">Options Controlling the Kind of Output</A></B>
<LI><B><A HREF="#SEC6">Options Controlling C Dialect</A></B>
<LI><B><A HREF="#SEC8">Options to Request or Suppress Warnings</A></B>
<LI><B><A HREF="#SEC9">Options for Debugging Your Program</A></B>
<LI><B><A HREF="#SEC10">Options That Control Optimization</A></B>
<LI><B><A HREF="#SEC11">Options Controlling the Preprocessor</A></B>
<LI><B><A HREF="#SEC12">Passing Options to the Assembler and Linker</A></B>
<LI><B><A HREF="#SEC14">Options for Directory Search</A></B>
<LI><B><A HREF="#SEC15">GCC Spec Strings</A></B>
<LI><B><A HREF="#SEC16">M680x0 Target Options</A></B>
<LI><B><A HREF="#SEC44">Options for Code Generation Conventions</A></B>
<LI><B><A HREF="#SEC45">Environment Variables Affecting GCC</A></B>
<LI><B><A HREF="#history">History</A></B>
<LI><B><A HREF="gnugpl.html">GNU General Public License</A></B>
<LI><B><A HREF="gnugpl.html#gnufdl">GNU Free Documentation License</A></B>
<LI><B><A HREF="gnugpl.html#funding">Funding Free Software</A></B>
</UL>
<P>Original author: Free Software Foundation, Inc.
<BR>
Authors of the modifications: Zeljko Juric, Sebastian Reichelt, and Kevin Kofler.
<BR>
Published by the TIGCC Team, and now the GCC4TI project.
<BR>
See the <A HREF="#history">History</A> section for details and copyright information.
<BR><BR>
Permission is granted to copy, distribute and/or modify this document
under the terms of the <A HREF="gnugpl.html#gnufdl">GNU Free Documentation License</A>, Version 1.1 or any
later version published by the Free Software Foundation; with the Invariant
Sections being "<A HREF="gnugpl.html">GNU General Public License</A>" and "<A HREF="gnugpl.html#funding">Funding Free Software</A>", the
Front-Cover texts being (a) (see below), and with the Back-Cover Texts being
(b) (see below). A copy of the license is included in the section entitled
"<A HREF="gnugpl.html#gnufdl">GNU Free Documentation License</A>".
<BR><BR>
(a) The FSF's Front-Cover Text is:
<BR><BR>
A GNU Manual
<BR><BR>
(b) The FSF's Back-Cover Text is:
<BR><BR>
You have freedom to copy and modify this GNU Manual, like GNU software.
Copies published by the Free Software Foundation raise funds for GNU
development.</P>
<HR>
<H2><A NAME="SEC3"><U>Options Available in the Command Line Compiler</U></A></H2>
<P>These options apply only to the command line compiler. If you want to use
the IDE instead, you do not need to worry about these topics.
<BR><BR>
<CODE>tigcc</CODE> has an important difference to the standard program
<CODE>gcc</CODE>: <CODE>tigcc</CODE> always overwrites assembly or
object files. For example, if a file <CODE>test.c</CODE> is compiled, the
files <CODE>test.s</CODE> and <CODE>test.o</CODE> will be created and
overwritten if necessary, but they will automatically be deleted again if
neither <B>'-c'</B> nor <B>'-S'</B> are specified.
<BR><BR>
Another important difference is that <CODE>tigcc</CODE> always looks for
libraries in the <CODE>'Lib'</CODE> subfolder of the installation.</P>
<DL>
<DT><P><B>-pack <I>varname</I></B></P><DD><P>Compress the file generated during compilation.
<I>varname</I> is the name of the on-calc packed variable. Although
<I>varname</I> cannot have an extension, the variable on the calculator will
always have the extension <CODE>ppg</CODE>. <I>varname</I> cannot be the
same as the on-calc name of the program itself. When you use this switch,
two files will be created; one with the extension <CODE>.89y</CODE> or
<CODE>.9xy</CODE>, and one <CODE>.89z</CODE> or <CODE>.9xz</CODE> file.
<BR><BR>
This option comes from
<A HREF="mailto:[email protected]">Thomas Nussbaumer</A>'s
TI-68k Developer Utilities (now built in GCC4TI), where this feature is called
"ExePack Technology." You can read about it on the official
<A HREF="http://tict.ticalc.org/">TI-Chess Team site</A>.
</P><DT><P><B>-q</B></P><DD><P>Keep as quiet as possible while assembling and linking. This option is
not needed by the compiler because it is always quiet, but the linker and
especially the assembler output some information.
</P><DT><P><B>-v0</B></P><DD><P>This switch is an addition to the <B>'-v'</B> switch. It tells GCC4TI to
output only the commands that are run directly. This was the default in some
previous releases.
</P><DT><P><B>-g</B></P><DD><P>The <B>'-g'</B> switch in GCC turns on debugging information in the
preferred format for the target. In GCC4TI, this is DWARF 2, which can be used
with a GDB-enabled TiEmu.
</P><DT><P><B>-standalone</B></P><DD><P>Do not link against <CODE>tigcc.a</CODE>. All of GCC's internal
functions are implemented in this library, as well as all non-TIOS functions.
Using one of these will result in an error from the linker.
</P><DT><P><B>-ar</B></P><DD><P>Create an archive (a static library) instead of a program. The resulting
file will have an <CODE>.a</CODE> ending.
</P><DT><P><B>-bsr</B></P><DD><P>This option is ignored for compatibility.</P>
</DL>
<P>In addition to these options, the <CODE>tigcc</CODE> program also accepts
most of the <A HREF="ld.html#invocation">linker options</A>.</P>
<HR>
<H2><A NAME="SEC4"><U>Options Controlling the Kind of Output</U></A></H2>
<P>Compilation can involve up to four stages: preprocessing, compilation
proper, assembly and linking, always in that order. The first three
stages apply to an individual source file, and end by producing an
object file; linking combines all the object files (those newly
compiled, and those specified as input) into an executable file.
<BR><BR>
For any given input file, the file name suffix determines what kind of
compilation is done (some of these apply only to TIGCC/GCC4TI):</P>
<DL>
<DT><P><B><I>file</I>.c</B></P><DD><P>C source code which must be preprocessed.
</P><DT><P><B><I>file</I>.s</B></P><DD><P>GNU Assembler code.
</P><DT><P><B><I>file</I>.S</B></P><DD><P>GNU Assembler code which must be preprocessed.
</P><DT><P><B><I>file</I>.asm</B></P><DD><P>A68k Assembler code.
</P><DT><P><B><I>file</I>.o</B></P><DD><P>COFF object file to be linked using <CODE>ld</CODE>.
</P><DT><P><B><I>file</I>.a</B></P><DD><P>Static library (function archive) to be linked using <CODE>ld</CODE>.</P>
</DL>
<P>You can specify the input language explicitly with the <B>'-x'</B> option:</P>
<DL>
<DT><P><B>-x <I>language</I></B></P><DD><P>Specify explicitly the <I>language</I> for the following input files
(rather than letting the compiler choose a default based on the file
name suffix). This option applies to all following input files until
the next <B>'-x'</B> option. Possible values for <I>language</I> are:
<BR>
<CODE>
c c-header cpp-output
c++ c++-cpp-output
objective-c objc-cpp-output
assembler assembler-with-cpp
ada
f77 f77-cpp-input ratfor
java
treelang
</CODE></P><DT><P><B>-x none</B></P><DD><P>Turn off any specification of a language, so that subsequent files are
handled according to their file name suffixes (as they are if <B>'-x'</B>
has not been used at all).
</P><DT><P><B>-pass-exit-codes</B></P><DD><P>Normally the <CODE>gcc</CODE> program will exit with the code of 1 if any
phase of the compiler returns a non-success return code. If you specify
<B>'-pass-exit-codes'</B>, the <CODE>gcc</CODE> program will instead return with
numerically highest error produced by any phase that returned an error
indication.</P>
</DL>
<P>If you only want some of the stages of compilation, you can use
<B>'-x'</B> (or filename suffixes) to tell <CODE>gcc</CODE> where to start, and
one of the options <B>'-c'</B>, <B>'-S'</B>, or <B>'-E'</B> to say where
<CODE>gcc</CODE> is to stop. Note that some combinations (for example,
<B>'-x cpp-output -E'</B>) instruct <CODE>gcc</CODE> to do nothing at all.</P>
<DL>
<DT><P><B>-c</B></P><DD><P>Compile or assemble the source files, but do not link. The linking
stage simply is not done. The ultimate output is in the form of an
object file for each source file.
<BR><BR>
By default, the object file name for a source file is made by replacing
the suffix <CODE>.c</CODE>, <CODE>.i</CODE>, <CODE>.s</CODE>, etc., with <CODE>.o</CODE>.
<BR><BR>
Unrecognized input files, not requiring compilation or assembly, are
ignored.
</P><DT><P><B>-S</B></P><DD><P>Stop after the stage of compilation proper; do not assemble. The output
is in the form of an assembler code file for each non-assembler input
file specified.
<BR><BR>
By default, the assembler file name for a source file is made by
replacing the suffix <CODE>.c</CODE>, <CODE>.i</CODE>, etc., with <CODE>.s</CODE>.
<BR><BR>
Input files that don't require compilation are ignored.
</P><DT><P><B>-E</B></P><DD><P>Stop after the preprocessing stage; do not run the compiler proper. The
output is in the form of preprocessed source code, which is sent to the
standard output.
<BR><BR>
Input files which don't require preprocessing are ignored.
</P><DT><P><B>-o <I>file</I></B></P><DD><P>Place output in file <I>file</I>. This applies regardless to whatever
sort of output is being produced, whether it be an executable file,
an object file, an assembler file or preprocessed C code.
<BR><BR>
Since only one output file can be specified, it does not make sense to
use <B>'-o'</B> when compiling more than one input file, unless you are
producing an executable file as output.
<BR><BR>
If <B>'-o'</B> is not specified, the default is to put an executable file
in <CODE>a.out</CODE>, the object file for <CODE><I>source</I>.<I>suffix</I></CODE> in
<CODE><I>source</I>.o</CODE>, its assembler file in <CODE><I>source</I>.s</CODE>, and
all preprocessed C source on standard output.
</P><DT><P><B>-v</B></P><DD><P>Print (on standard error output) the commands executed to run the stages
of compilation. Also print the version number of the compiler driver
program and of the preprocessor and the compiler proper.
</P><DT><P><B>-###</B></P><DD><P>Like <B>'-v'</B> except the commands are not executed and all command
arguments are quoted. This is useful for shell scripts to capture the
driver-generated command lines.
</P><DT><P><B>-pipe</B></P><DD><P>Use pipes rather than temporary files for communication between the
various stages of compilation. This fails to work on some systems where
the assembler is unable to read from a pipe; but the GNU assembler has
no trouble.
</P><DT><P><B>--help</B></P><DD><P>Print (on the standard output) a description of the command line options
understood by <CODE>gcc</CODE>. If the <B>'-v'</B> option is also specified
then <B>'--help'</B> will also be passed on to the various processes
invoked by <CODE>gcc</CODE>, so that they can display the command line options
they accept. If the <B>'-W'</B> option is also specified then command
line options which have no documentation associated with them will also
be displayed.
</P><DT><P><B>--target-help</B></P><DD><P>Print (on the standard output) a description of target specific command
line options for each tool.
</P><DT><P><B>--version</B></P><DD><P>Display the version number and copyrights of the invoked GCC.</P>
</DL>
<HR>
<H2><A NAME="SEC6"><U>Options Controlling C Dialect</U></A></H2>
<P>The following options control the dialect of C that the compiler accepts:</P>
<DL>
<DT><P><B>-ansi</B></P><DD><P>Support all ISO C89 programs.
This turns off certain features of GCC that are incompatible with ISO C89,
such as the <CODE>asm</CODE> and <CODE>typeof</CODE> keywords, and
some predefined macros that identify the
type of system you are using. It also enables the undesirable and
rarely used ISO trigraph feature, and disables recognition of C++ style
<CODE>//</CODE> comments as well as the <CODE>inline</CODE> keyword.
<BR><BR>
The alternate keywords <CODE>__asm__</CODE>, <CODE>__extension__</CODE>,
<CODE>__inline__</CODE> and <CODE>__typeof__</CODE> continue to work despite
<B>'-ansi'</B>. You would not want to use them in an ISO C program, of
course, but it is useful to put them in header files that might be included
in compilations done with <B>'-ansi'</B>. Alternate predefined macros
such as <CODE>__unix__</CODE> are also available, with or
without <B>'-ansi'</B>.
<BR><BR>
The <B>'-ansi'</B> option does not cause non-ISO programs to be
rejected gratuitously. For that, <B>'-pedantic'</B> is required in
addition to <B>'-ansi'</B>. See <A HREF="#SEC8">Warning Options</A>.
<BR><BR>
The macro <CODE>__STRICT_ANSI__</CODE> is predefined when the <B>'-ansi'</B>
option is used. Some header files may notice this macro and refrain
from declaring certain functions or defining certain macros that the
ISO standard doesn't call for; this is to avoid interfering with any
programs that might use these names for other things.
<BR><BR>
Functions which would normally be built in but do not have semantics
defined by ISO C (such as <A HREF="alloc.html#alloca">alloca</A>) are not built-in
functions with <B>'-ansi'</B> is used. See <A HREF="gnuexts.html#SEC104">Other
built-in functions provided by GCC</A> for details of the functions
affected.
<BR><BR>
<B>Note:</B> At the moment, the GCC4TI library depends heavily on GNU C extensions,
so you cannot use the <B>'-ansi'</B> switch in GCC4TI.
</P><DT><P><B>-std=<I>standard</I></B></P><DD><P>Determine the language standard. A value for <I>standard</I> must be provided;
provided; possible values are
</P>
<DL>
<DT><P><B>c89</B>
<BR><B>iso9899:1990</B></P><DD><P>ISO C90 (same as <B>'-ansi'</B>).
</P><DT><P><B>iso9899:199409</B></P><DD><P>ISO C90 as modified in amendment 1.
</P><DT><P><B>c99</B>
<BR><B>c9x</B>
<BR><B>iso9899:1999</B>
<BR><B>iso9899:199x</B></P><DD><P>ISO C99. Note that this standard is not yet fully supported; see
<A HREF="http://gcc.gnu.org/gcc-3.3/c99status.html">http://gcc.gnu.org/gcc-3.3/c99status.html</A> for more information. The
names <CODE>c9x</CODE> and <CODE>iso9899:199x</CODE> are deprecated.
</P><DT><P><B>gnu89</B></P><DD><P>Default, ISO C90 plus GNU extensions (including some C99 features).
</P><DT><P><B>gnu99</B>
<BR><B>gnu9x</B></P><DD><P>ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
this will become the default. The name <CODE>gnu9x</CODE> is deprecated.</P>
</DL>
<P>
Even when this option is not specified, you can still use some of the
features of newer standards in so far as they do not conflict with
previous C standards. For example, you may use <CODE>__restrict__</CODE> even
when <B>'-std=c99'</B> is not specified.
<BR><BR>
The <B>'-std'</B> options specifying some version of ISO C have the same
effects as <B>'-ansi'</B>, except that features that were not in ISO C90
but are in the specified version (for example, <CODE>//</CODE> comments and
the <CODE>inline</CODE> keyword in ISO C99) are not disabled.
</P><DT><P><B>-aux-info <I>filename</I></B></P><DD><P>Output to the given filename prototyped declarations for all functions
declared and/or defined in a translation unit, including those in header
files. This option is silently ignored in any language other than C.
<BR><BR>
Besides declarations, the file indicates, in comments, the origin of
each declaration (source file and line), whether the declaration was
implicit, prototyped or unprototyped (<CODE>I</CODE>, <CODE>N</CODE> for new or
<CODE>O</CODE> for old, respectively, in the first character after the line
number and the colon), and whether it came from a declaration or a
definition (<CODE>C</CODE> or <CODE>F</CODE>, respectively, in the following
character). In the case of function definitions, a K&R-style list of
arguments followed by their declarations is also provided, inside
comments, after the declaration.
</P><DT><P><B>-fno-asm</B></P><DD><P>Do not recognize <CODE>asm</CODE>, <CODE>inline</CODE> or <CODE>typeof</CODE> as a
keyword, so that code can use these words as identifiers. You can use
the keywords <CODE>__asm__</CODE>, <CODE>__inline__</CODE> and <CODE>__typeof__</CODE>
instead. <B>'-ansi'</B> implies <B>'-fno-asm'</B>.
</P><DT><P><B>-fno-builtin</B>
<BR><B>-fno-builtin-<I>function</I></B></P><DD><P>Don't recognize built-in functions that do not begin with
<CODE>__builtin_</CODE> as prefix. See <A HREF="gnuexts.html#SEC104">Other built-in
functions provided by GCC</A> for details of the functions affected,
including those which are not built-in functions when <B>'-ansi'</B> or
<B>'-std'</B> options for strict ISO C conformance are used because they
do not have an ISO standard meaning.
<BR><BR>
GCC normally generates special code to handle certain built-in functions
more efficiently; for instance, calls to <A HREF="alloc.html#alloca">alloca</A> may become single
instructions that adjust the stack directly. The resulting code is often both smaller
and faster, but since the function calls no longer appear as such, you
cannot set a breakpoint on those calls, nor can you change the behavior
of the functions by linking with a different library.
<BR><BR>
With the <B>'-fno-builtin-<I>function</I>'</B> option,
only the built-in function <I>function</I> is
disabled. <I>function</I> must not begin with <CODE>__builtin_</CODE>. If a
function is named this is not built-in in this version of GCC, this
option is ignored. There is no corresponding
<B>'-fbuiltin-<I>function</I>'</B> option; if you wish to enable
built-in functions selectively when using <B>'-fno-builtin'</B> or
<B>'-ffreestanding'</B>, you may define macros such as:</P>
<PRE>#define abs(n) __builtin_abs ((n))
#define strcpy(d, s) __builtin_strcpy ((d), (s))
</PRE>
<DT><P><B>-fhosted</B></P><DD><P>Assert that compilation takes place in a hosted environment. This implies
<B>'-fbuiltin'</B>. A hosted environment is one in which the
entire standard library is available, and in which <CODE>main</CODE> has a return
type of <CODE>int</CODE>. Examples are nearly everything except a kernel.
This is equivalent to <B>'-fno-freestanding'</B>.
<BR><BR>
Although TI calculators are not really hosted environments, <B>'-fhosted'</B>
is kept as the default.
</P><DT><P><B>-ffreestanding</B></P><DD><P>Assert that compilation takes place in a freestanding environment. This
implies <B>'-fno-builtin'</B>. A freestanding environment
is one in which the standard library may not exist, and program startup may
not necessarily be at <CODE>main</CODE>. The most obvious example is an OS kernel.
This is equivalent to <B>'-fno-hosted'</B>.
</P><DT><P><B>-fms-extensions</B></P><DD><P>Accept some non-standard constructs used in Microsoft header files.
</P><DT><P><B>-trigraphs</B></P><DD><P>Support ISO C trigraphs. The <B>'-ansi'</B> option (and <B>'-std'</B>
options for strict ISO C conformance) implies <B>'-trigraphs'</B>.
See <A HREF="#SEC11">Options Controlling the Preprocessor</A> for more information.
</P><DT><P><B>-no-integrated-cpp</B></P><DD><P>Performs a compilation in two passes: preprocessing and compiling. This
option allows a user supplied "cc1" via the
<B>'-B'</B> option. The user supplied compilation step can then add in
an additional preprocessing step after normal preprocessing but before
compiling. The default is to use the integrated preprocessor.
<BR><BR>
The semantics of this option will change if "cc1", "cc1plus", and
"cc1obj" are merged.
</P><DT><P><B>-traditional</B>
<BR><B>-traditional-cpp</B></P><DD><P>Formerly, these options caused GCC to attempt to emulate a pre-standard
C compiler. They are now only supported with the <B>'-E'</B> switch.
The preprocessor continues to support a <A HREF="CPP.html#SEC70">pre-standard mode</A>.
</P><DT><P><B>-fcond-mismatch</B></P><DD><P>Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void.
</P><DT><P><B>-funsigned-char</B></P><DD><P>Let the type <CODE><A HREF="keywords.html#int">char</A></CODE> be unsigned, like <CODE>unsigned char</CODE>.
In GCC4TI, the default is <CODE>signed char</CODE>.
<BR><BR>
Ideally, a portable program should always use <CODE>signed char</CODE> or
<CODE>unsigned char</CODE> when it depends on the signedness of an object.
But many programs have been written to use plain <CODE>char</CODE> and
expect it to be signed, or expect it to be unsigned, depending on the
machines they were written for. This option, and its inverse, let you
make such a program work with the opposite default.
<BR><BR>
The type <CODE>char</CODE> is always a distinct type from each of
<CODE>signed char</CODE> or <CODE>unsigned char</CODE>, even though its behavior
is always just like one of those two.
</P><DT><P><B>-fsigned-char</B></P><DD><P>Let the type <CODE><A HREF="keywords.html#int">char</A></CODE> be signed, like <CODE>signed char</CODE>.
<BR><BR>
Note that this is equivalent to <B>'-fno-unsigned-char'</B>, which is
the negative form of <B>'-funsigned-char'</B>. Likewise, the option
<B>'-fno-signed-char'</B> is equivalent to <B>'-funsigned-char'</B>.
</P><DT><P><B>-fsigned-bitfields</B>
<BR><B>-funsigned-bitfields</B>
<BR><B>-fno-signed-bitfields</B>
<BR><B>-fno-unsigned-bitfields</B></P><DD><P>These options control whether a bit-field is signed or unsigned, when the
declaration does not use either <CODE>signed</CODE> or <CODE>unsigned</CODE>. By
default, such a bit-field is signed, because this is consistent: the
basic integer types such as <CODE>int</CODE> are signed types.
</P><DT><P><B>-fwritable-strings</B></P><DD><P>Store string constants in the writable data segment and don't uniquize
them. This is for compatibility with old programs which assume they can
write into string constants.
<BR><BR>
Writing into string constants is a very bad idea; "constants" should
be constant.</P>
</DL>
<HR>
<H2><A NAME="SEC8"><U>Options to Request or Suppress Warnings</U></A></H2>
<P>Warnings are diagnostic messages that report constructions which
are not inherently erroneous but which are risky or suggest there
may have been an error.
<BR><BR>
You can request many specific warnings with options beginning <B>'-W'</B>,
for example <B>'-Wimplicit'</B> to request warnings on implicit
declarations. Each of these specific warning options also has a
negative form beginning <B>'-Wno-'</B> to turn off warnings;
for example, <B>'-Wno-implicit'</B>. This manual lists only one of the
two forms, whichever is not the default.
<BR><BR>
The following options control the amount and kinds of warnings produced
by GCC.</P>
<DL>
<DT><P><B>-fsyntax-only</B></P><DD><P>Check the code for syntax errors, but don't do anything beyond that.
</P><DT><P><B>-pedantic</B></P><DD><P>Issue all the warnings demanded by strict ISO C;
reject all programs that use forbidden extensions, and some other
programs that do not follow ISO C. This option follows the
version of the ISO C standard specified by any <B>'-std'</B> option used.
<BR><BR>
Valid ISO C programs should compile properly with or without
this option (though a rare few will require <B>'-ansi'</B> or a
<B>'-std'</B> option specifying the required version of ISO C). However,
without this option, certain GNU extensions and traditional C
features are supported as well. With this option, they are rejected.
<BR><BR>
<B>'-pedantic'</B> does not cause warning messages for use of the
alternate keywords whose names begin and end with <CODE>__</CODE>. Pedantic
warnings are also disabled in the expression that follows
<CODE>__extension__</CODE>. However, only system header files should use
these escape routes; application programs should avoid them.
See <A HREF="gnuexts.html#SEC100">Alternate Keywords</A>.
<BR><BR>
Some users try to use <B>'-pedantic'</B> to check programs for strict ISO
C conformance. They soon find that it does not do quite what they want:
it finds some non-ISO practices, but not all - only those for which
ISO C <I>requires</I> a diagnostic, and some others for which
diagnostics have been added.
<BR><BR>
A feature to report any failure to conform to ISO C might be useful in
some instances, but would require considerable additional work and would
be quite different from <B>'-pedantic'</B>. The GNU team doesn't have plans to
support such a feature in the near future.
<BR><BR>
Where the standard specified with <B>'-std'</B> represents a GNU
extended dialect of C, such as <CODE>gnu89</CODE> or <CODE>gnu99</CODE>, there is a
corresponding <U>base standard</U>, the version of ISO C on which the GNU
extended dialect is based. Warnings from <B>'-pedantic'</B> are given
where they are required by the base standard. (It would not make sense
for such warnings to be given only for features not in the specified GNU
C dialect, since by definition the GNU dialects of C include all
features the compiler supports with the given option, and there would be
nothing to warn about.)
</P><DT><P><B>-pedantic-errors</B></P><DD><P>Like <B>'-pedantic'</B>, except that errors are produced rather than
warnings.
</P><DT><P><B>-w</B></P><DD><P>Inhibit all warning messages.
</P><DT><P><B>-Wno-import</B></P><DD><P>Inhibit warning messages about the use of <CODE><A HREF="cpp.html#SEC84">#import</A></CODE>.
</P><DT><P><B>-Wchar-subscripts</B></P><DD><P>Warn if an array subscript has type <CODE><A HREF="keywords.html#int">char</A></CODE>. This is a common cause
of error, as programmers often forget that this type is signed on some
machines.
</P><DT><P><B>-Wcomment</B></P><DD><P>Warn whenever a comment-start sequence <CODE>/*</CODE> appears in a <CODE>/*</CODE>
comment, or whenever a Backslash-Newline appears in a <CODE>//</CODE> comment.
</P><DT><P><B>-Wformat</B></P><DD><P>Check calls to <A HREF="stdio.html#printf">printf</A> and <A HREF="stdio.html#scanf">scanf</A>, etc., to make sure that
the arguments supplied have types appropriate to the format string
specified, and that the conversions specified in the format string make
sense. This includes standard functions, and others specified by format
attributes (see <A HREF="gnuexts.html#SEC85_format">format</A>).
<BR><BR>
Since <B>'-Wformat'</B> also checks for null format arguments for
several functions, <B>'-Wformat'</B> also implies <B>'-Wnonnull'</B>.
<BR><BR>
<B>'-Wformat'</B> is included in <B>'-Wall'</B>. For more control over some
aspects of format checking, the options
<B>'-Wno-format-extra-args'</B>, <B>'-Wno-format-zero-length'</B>,
<B>'-Wformat-nonliteral'</B>, <B>'-Wformat-security'</B>, and
<B>'-Wformat=2'</B> are available, but are not included in <B>'-Wall'</B>.
</P><DT><P><B>-Wno-format-extra-args</B></P><DD><P>If <B>'-Wformat'</B> is specified, do not warn about excess arguments to a
<A HREF="stdio.html#printf">printf</A> or <A HREF="stdio.html#scanf">scanf</A> format function. The C standard specifies
that such arguments are ignored.
</P><DT><P><B>-Wno-format-zero-length</B></P><DD><P>If <B>'-Wformat'</B> is specified, do not warn about zero-length formats.
The C standard specifies that zero-length formats are allowed.
</P><DT><P><B>-Wformat-nonliteral</B></P><DD><P>If <B>'-Wformat'</B> is specified, also warn if the format string is not a
string literal and so cannot be checked, unless the format function
takes its format arguments as a <A HREF="stdarg.html#va_list">va_list</A>.
</P><DT><P><B>-Wformat-security</B></P><DD><P>If <B>'-Wformat'</B> is specified, also warn about uses of format
functions that represent possible security problems. At present, this
warns about calls to <A HREF="stdio.html#printf">printf</A> and <A HREF="stdio.html#scanf">scanf</A> functions where the
format string is not a string literal and there are no format arguments,
as in <CODE>printf (foo);</CODE>. This may be a security hole if the format
string came from untrusted input and contains <CODE>%n</CODE>. (This is
currently a subset of what <B>'-Wformat-nonliteral'</B> warns about, but
in future warnings may be added to <B>'-Wformat-security'</B> that are not
included in <B>'-Wformat-nonliteral'</B>.)
</P><DT><P><B>-Wformat=2</B></P><DD><P>Enable <B>'-Wformat'</B> plus format checks not included in
<B>'-Wformat'</B>. Currently equivalent to <B>'-Wformat
-Wformat-nonliteral -Wformat-security'</B>.
</P><DT><P><B>-Wnonnull</B></P><DD><P>Enable warning about passing a null pointer for arguments marked as
requiring a non-null value by the <CODE>nonnull</CODE> function attribute.
<BR><BR>
<B>'-Wnonnull'</B> is included in <B>'-Wall'</B> and <B>'-Wformat'</B>. It
can be disabled with the <B>'-Wno-nonnull'</B> option.
</P><DT><P><B>-Wimplicit-int</B></P><DD><P>Warn when a declaration does not specify a type.
</P><DT><P><B>-Wimplicit-function-declaration</B>
<BR><B>-Werror-implicit-function-declaration</B></P><DD><P>Give a warning (or error) whenever a function is used before being
declared.
</P><DT><P><B>-Wimplicit</B></P><DD><P>Same as <B>'-Wimplicit-int -Wimplicit-function-declaration'</B>.
</P><DT><P><B>-Wmissing-braces</B></P><DD><P>Warn if an aggregate or union initializer is not fully bracketed. In
the following example, the initializer for <CODE>a</CODE> is not fully
bracketed, but that for <CODE>b</CODE> is fully bracketed.</P>
<PRE>int a[2][2] = { 0, 1, 2, 3 };
int b[2][2] = { { 0, 1 }, { 2, 3 } };
</PRE>
<DT><P><B>-Wparentheses</B></P><DD><P>Warn if parentheses are omitted in certain contexts, such
as when there is an assignment in a context where a truth value
is expected, or when operators are nested whose precedence people
often get confused about.
<BR><BR>
Also warn about constructions where there may be confusion to which
<CODE><A HREF="keywords.html#if">if</A></CODE> statement an <CODE><A HREF="keywords.html#if">else</A></CODE> branch belongs. Here is an example of
such a case:</P>
<PRE>{
if (a)
if (b)
foo ();
else
bar ();
}
</PRE>
<P>In C, every <CODE>else</CODE> branch belongs to the innermost possible <CODE>if</CODE>
statement, which in this example is <CODE>if (b)</CODE>. This is often not
what the programmer expected, as illustrated in the above example by the
indentation the programmer chose. When there is the potential for this
confusion, GCC will issue a warning when this flag is specified.
To eliminate the warning, add explicit braces around the innermost
<CODE>if</CODE> statement so there is no way the <CODE>else</CODE> could belong to
the enclosing <CODE>if</CODE>. The resulting code would look like this:</P>
<PRE>{
if (a)
{
if (b)
foo ();
else
bar ();
}
}
</PRE>
<DT><P><B>-Wsequence-point</B></P><DD><P>Warn about code that may have undefined semantics because of violations
of sequence point rules in the C standard.
<BR><BR>
The C standard defines the order in which expressions in a C program are
evaluated in terms of <U>sequence points</U>, which represent a partial
ordering between the execution of parts of the program: those executed
before the sequence point, and those executed after it. These occur
after the evaluation of a full expression (one which is not part of a
larger expression), after the evaluation of the first operand of a
<CODE>&&</CODE>, <CODE>||</CODE>, <CODE>? :</CODE> or <CODE>,</CODE> (comma) operator, before a
function is called (but after the evaluation of its arguments and the
expression denoting the called function), and in certain other places.
Other than as expressed by the sequence point rules, the order of
evaluation of subexpressions of an expression is not specified. All
these rules describe only a partial order rather than a total order,
since, for example, if two functions are called within one expression
with no sequence point between them, the order in which the functions
are called is not specified. However, the standards committee have
ruled that function calls do not overlap.
<BR><BR>
It is not specified when between sequence points modifications to the
values of objects take effect. Programs whose behavior depends on this
have undefined behavior; the C standard specifies that "Between the
previous and next sequence point an object shall have its stored value
modified at most once by the evaluation of an expression. Furthermore,
the prior value shall be read only to determine the value to be
stored.". If a program breaks these rules, the results on any
particular implementation are entirely unpredictable.
<BR><BR>
Examples of code with undefined behavior are <CODE>a = a++;</CODE>, <CODE>a[n]
= b[n++]</CODE> and <CODE>a[i++] = i;</CODE>. Some more complicated cases are not
diagnosed by this option, and it may give an occasional false positive
result, but in general it has been found fairly effective at detecting
this sort of problem in programs.
<BR><BR>
The C standard is worded confusingly, therefore there is some debate
over the precise meaning of the sequence point rules in subtle cases.
Links to discussions of the problem, including proposed formal
definitions, may be found on the GCC readings page, at
<A HREF="http://gcc.gnu.org/readings.html">http://gcc.gnu.org/readings.html</A>.
</P><DT><P><B>-Wreturn-type</B></P><DD><P>Warn whenever a function is defined with a return-type that defaults to
<CODE><A HREF="keywords.html#int">int</A></CODE>. Also warn about any <CODE>return</CODE> statement with no
return-value in a function whose return-type is not <CODE><A HREF="keywords.html#void">void</A></CODE>.
</P><DT><P><B>-Wswitch</B></P><DD><P>Warn whenever a <CODE><A HREF="keywords.html#switch">switch</A></CODE> statement has an index of enumeral type
and lacks a <CODE><A HREF="keywords.html#switch">case</A></CODE> for one or more of the named codes of that
enumeration. (The presence of a <CODE>default</CODE> label prevents this
warning.) <CODE>case</CODE> labels outside the enumeration range also
provoke warnings when this option is used.
</P><DT><P><B>-Wswitch-default</B></P><DD><P>Warn whenever a <CODE>switch</CODE> statement does not have a <CODE>default</CODE>
case.
</P><DT><P><B>-Wswitch-enum</B></P><DD><P>Warn whenever a <CODE>switch</CODE> statement has an index of enumeral type
and lacks a <CODE>case</CODE> for one or more of the named codes of that
enumeration. <CODE>case</CODE> labels outside the enumeration range also
provoke warnings when this option is used.
</P><DT><P><B>-Wtrigraphs</B></P><DD><P>Warn if any trigraphs are encountered that might change the meaning of
the program (trigraphs within comments are not warned about).
For more information about trigraphs, see <A HREF="#SEC11">Options Controlling the Preprocessor</A>.
</P><DT><P><B>-Wunused-function</B></P><DD><P>Warn whenever a static function is declared but not defined or a
non\-inline static function is unused.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="gnuexts.html#SEC85_unused">unused</A></CODE> attribute.
</P><DT><P><B>-Wunused-label</B></P><DD><P>Warn whenever a label is declared but not used.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="gnuexts.html#SEC91_unused">unused</A></CODE> attribute.
</P><DT><P><B>-Wunused-parameter</B></P><DD><P>Warn whenever a function parameter is unused aside from its declaration.
<BR><BR>
To suppress this warning, use the <CODE><A HREF="gnuexts.html#SEC91_unused">unused</A></CODE> attribute.
</P><DT><P><B>-Wunused-variable</B></P><DD><P>Warn whenever a local variable or non-constant static variable is unused
aside from its declaration
<BR><BR>
To suppress this warning, use the <CODE><A HREF="gnuexts.html#SEC91_unused">unused</A></CODE> attribute.
</P><DT><P><B>-Wunused-value</B></P><DD><P>Warn whenever a statement computes a result that is explicitly not used.
<BR><BR>
To suppress this warning, cast the expression to <CODE><A HREF="keywords.html#void">void</A></CODE>.
</P><DT><P><B>-Wunused</B></P><DD><P>All the above <B>'-Wunused'</B> options combined.
<BR><BR>
In order to get a warning about an unused function parameter, you must
either specify <B>'-W -Wunused'</B> or separately specify
<B>'-Wunused-parameter'</B>.
</P><DT><P><B>-Wuninitialized</B></P><DD><P>Warn if an automatic variable is used without first being initialized or
if a variable may be clobbered by a <A HREF="setjmp.html#setjmp">setjmp</A> call
(I am not sure whether <A HREF="setjmp.html#setjmp">setjmp</A> problems may be detected in GCC4TI).
<BR><BR>
These warnings are possible only in optimizing compilation,
because they require data flow information that is computed only
when optimizing. If you don't specify <B>'-O'</B>, you simply won't
get these warnings.
<BR><BR>
These warnings occur only for variables that are candidates for
register allocation. Therefore, they do not occur for a variable that
is declared <CODE><A HREF="keywords.html#volatile">volatile</A></CODE>, or whose address is taken, or whose size
is other than 1, 2, 4 or 8 bytes. Also, they do not occur for
structures, unions or arrays, even when they are in registers.
<BR><BR>
Note that there may be no warning about a variable that is used only
to compute a value that itself is never used, because such
computations may be deleted by data flow analysis before the warnings
are printed.
<BR><BR>
These warnings are made optional because GCC is not smart
enough to see all the reasons why the code might be correct
despite appearing to have an error. Here is one example of how
this can happen:</P>
<PRE>{
int x;
switch (y)
{
case 1: x = 1;
break;
case 2: x = 4;
break;
case 3: x = 5;
}
foo (x);
}
</PRE>
<P>If the value of <I>y</I> is always 1, 2 or 3, then <I>x</I> is
always initialized, but GCC doesn't know this. Here is
another common case:</P>
<PRE>{
int save_y;
if (change_y) save_y = y, y = new_y;
...
if (change_y) y = save_y;
}
</PRE>
<P>This has no bug because <I>save_y</I> is used only if it is set.
<BR><BR>
This option also warns when a non-volatile automatic variable might be
changed by a call to <A HREF="setjmp.html#longjmp">longjmp</A>. These warnings as well are possible
only in optimizing compilation
(although I am not sure whether they can be caught at all in GCC4TI).
<BR><BR>
The compiler sees only the calls to <A HREF="setjmp.html#setjmp">setjmp</A>. It cannot know
where <A HREF="setjmp.html#longjmp">longjmp</A> will be called; in fact, an interrupt handler could
call it at any point in the code. As a result, you may get a warning
even when there is in fact no problem because <A HREF="setjmp.html#longjmp">longjmp</A> cannot
in fact be called at the place which would cause a problem.
<BR><BR>
Some spurious warnings can be avoided if you declare all the functions
you use that never return as <A HREF="gnuexts.html#SEC85_noreturn">noreturn</A>.
</P><DT><P><B>-Wunknown-pragmas</B></P><DD><P>Warn when a <CODE><A HREF="cpp.html#SEC46">#pragma</A></CODE> directive is encountered which is not understood by
GCC. If this command line option is used, warnings will even be issued
for unknown pragmas in system header files. This is not the case if
the warnings were only enabled by the <B>'-Wall'</B> command line option.
</P><DT><P><B>-Wstrict-aliasing</B></P><DD><P>This option is only active when <B>'-fstrict-aliasing'</B> is active.
It warns about code which might break the strict aliasing rules that the
compiler is using for optimization. The warning does not catch all
cases, but does attempt to catch the more common pitfalls. It is
included in <B>'-Wall'</B>.
</P><DT><P><B>-Wall</B></P><DD><P>All of the above <B>'-W'</B> options combined. This enables all the
warnings about constructions that some users consider questionable, and
that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros.</P>
</DL>
<P>The following <B>'-W...'</B> options are not implied by <B>'-Wall'</B>.
Some of them warn about constructions that users generally do not
consider questionable, but which occasionally you might wish to check
for; others warn about constructions that are necessary or hard to avoid
in some cases, and there is no simple way to modify the code to suppress
the warning.</P>
<DL>
<DT><P><B>-W</B></P><DD><P>Print extra warning messages for these events:</P>
<UL>
<LI><P>A function can return either with or without a value. (Falling
off the end of the function body is considered returning without
a value.) For example, this function would evoke such a
warning:</P>
<PRE>foo (a)
{
if (a > 0)
return a;
}
</PRE>
</LI>
<LI><P>An expression-statement or the left-hand side of a comma expression
contains no side effects.
To suppress the warning, cast the unused expression to void.
For example, an expression such as <CODE>x[i,j]</CODE> will cause a warning,
but <CODE>x[(void)i,j]</CODE> will not.
</P></LI>
<LI><P>An unsigned value is compared against zero with <CODE><</CODE> or <CODE><=</CODE>.
</P></LI>
<LI><P>A comparison like <CODE>x<=y<=z</CODE> appears; this is equivalent to
<CODE>(x<=y ? 1 : 0) <= z</CODE>, which is a different interpretation from
that of ordinary mathematical notation.
</P></LI>
<LI><P>Storage-class specifiers like <CODE>static</CODE> are not the first things in
a declaration. According to the C Standard, this usage is obsolescent.
</P></LI>
<LI><P>The return type of a function has a type qualifier such as <CODE>const</CODE>.
Such a type qualifier has no effect, since the value returned by a
function is not an lvalue. (But don't warn about the GNU extension of
<CODE>volatile void</CODE> return types. That extension will be warned about
if <B>'-pedantic'</B> is specified.)
</P></LI>
<LI><P>If <B>'-Wall'</B> or <B>'-Wunused'</B> is also specified, warn about unused
arguments.
</P></LI>
<LI><P>A comparison between signed and unsigned values could produce an
incorrect result when the signed value is converted to unsigned.
(But don't warn if <B>'-Wno-sign-compare'</B> is also specified.)
</P></LI>
<LI><P>An aggregate has a partly bracketed initializer.
For example, the following code would evoke such a warning,
because braces are missing around the initializer for <I>x</I>.<I>h</I>:</P>
<PRE>struct s { int f, g; };
struct t { struct s h; int i; };
struct t x = { 1, 2, 3 };
</PRE>
</LI>
<LI><P>An aggregate has an initializer which does not initialize all members.
For example, the following code would cause such a warning, because
<I>x</I>.<I>h</I> would be implicitly initialized to zero:</P>
<PRE>struct s { int f, g, h; };
struct s x = { 3, 4 };
</PRE>
</LI>
</UL>
<DT><P><B>-Wno-div-by-zero</B></P><DD><P>Do not warn about compile-time integer division by zero. Floating point
division by zero is not warned about, as it can be a legitimate way of
obtaining infinities and NaNs.
</P><DT><P><B>-Wsystem-headers</B></P><DD><P>Print warning messages for constructs found in system header files.
Warnings from system headers are normally suppressed, on the assumption
that they usually do not indicate real problems and would only make the
compiler output harder to read. Using this command line option tells
GCC to emit warnings from system headers as if they occurred in user
code. However, note that using <B>'-Wall'</B> in conjunction with this
option will <I>not</I> warn about unknown pragmas in system
headers - for that, <B>'-Wunknown-pragmas'</B> must also be used.
<BR><BR>
Note that the GCC4TI Library header files are not included as system header
files.
</P><DT><P><B>-Wfloat-equal</B></P><DD><P>Warn if floating point values are used in equality comparisons.
<BR><BR>
The idea behind this is that sometimes it is convenient (for the
programmer) to consider floating-point values as approximations to
infinitely precise real numbers. If you are doing this, then you need
to compute (by analyzing the code, or in some other way) the maximum or
likely maximum error that the computation introduces, and allow for it
when performing comparisons (and when producing output, but that's a
different problem). In particular, instead of testing for equality, you
would check to see whether the two values have ranges that overlap; and
this is done with the relational operators, so equality comparisons are
probably mistaken.
</P><DT><P><B>-Wtraditional</B></P><DD><P>Warn about certain constructs that behave differently in traditional and
ISO C. Also warn about ISO C constructs that have no traditional C
equivalent, and/or problematic constructs which should be avoided.</P>
<UL>
<LI><P>Macro parameters that appear within string literals in the macro body.
In traditional C macro replacement takes place within string literals,
but does not in ISO C.
</P></LI>
<LI><P>In traditional C, some preprocessor directives did not exist.
Traditional preprocessors would only consider a line to be a directive
if the <CODE>#</CODE> appeared in column 1 on the line. Therefore
<B>'-Wtraditional'</B> warns about directives that traditional C
understands but would ignore because the <CODE>#</CODE> does not appear as the
first character on the line. It also suggests you hide directives like
<CODE><A HREF="cpp.html#SEC46">#pragma</A></CODE> not understood by traditional C by indenting them. Some
traditional implementations would not recognize <CODE><A HREF="cpp.html#SEC36">#elif</A></CODE>, so it
suggests avoiding it altogether.
</P></LI>
<LI><P>A function-like macro that appears without arguments.
</P></LI>
<LI><P>The unary plus operator.
</P></LI>
<LI><P>The <CODE>U</CODE> integer constant suffix, or the <CODE>F</CODE> or <CODE>L</CODE> floating point
constant suffixes. (Traditional C does support the <CODE>L</CODE> suffix on integer
constants.) Note, these suffixes appear in macros defined in <A HREF="limits.html">limits.h</A>,
for example.
</P></LI>
<LI><P>A function declared external in one block and then used after the end of
the block.
</P></LI>
<LI><P>A <CODE><A HREF="keywords.html#switch">switch</A></CODE> statement has an operand of type <CODE><A HREF="keywords.html#short">long</A></CODE>.
</P></LI>
<LI><P>A non-<CODE><A HREF="keywords.html#static">static</A></CODE> function declaration follows a <CODE>static</CODE> one.
This construct is not accepted by some traditional C compilers.
</P></LI>
<LI><P>The ISO type of an integer constant has a different width or
signedness from its traditional type. This warning is only issued if
the base of the constant is 10, i.e. hexadecimal or octal values, which
typically represent bit patterns, are not warned about.
</P></LI>
<LI><P>Usage of ISO string concatenation is detected.
</P></LI>
<LI><P>Initialization of automatic aggregates.
</P></LI>
<LI><P>Identifier conflicts with labels. Traditional C lacks a separate
namespace for labels.
</P></LI>
<LI><P>Initialization of unions. If the initializer is zero, the warning is
omitted. This is done under the assumption that the zero initializer in
user code appears conditioned on e.g. <A HREF="cpp.html#SEC15_STDC">__STDC__</A> to avoid missing
initializer warnings and relies on default initialization to zero in the
traditional C case.
</P></LI>
<LI><P>Conversions by prototypes between fixed/floating point values and vice
versa. The absence of these prototypes when compiling with traditional
C would cause serious problems. This is a subset of the possible
conversion warnings, for the full set use <B>'-Wconversion'</B>.
</P></LI>
<LI><P>Use of ISO C style function definitions. This warning intentionally is
<I>not</I> issued for prototype declarations or variadic functions
because these ISO C features will appear in your code when using
libiberty's traditional C compatibility macros, <CODE>PARAMS</CODE> and
<CODE>VPARAMS</CODE>. This warning is also bypassed for nested functions
because that feature is already a gcc extension and thus not relevant to
traditional C compatibility.</P></LI>
</UL>
<DT><P><B>-Wundef</B></P><DD><P>Warn if an undefined identifier is evaluated in an <CODE>#if</CODE> directive.
</P><DT><P><B>-Wendif-labels</B></P><DD><P>Warn whenever an <CODE>#else</CODE> or an <CODE>#endif</CODE> are followed by text.
</P><DT><P><B>-Wshadow</B></P><DD><P>Warn whenever a local variable shadows another local variable, parameter or
global variable or whenever a built-in function is shadowed.
</P><DT><P><B>-Wlarger-than-<I>len</I></B></P><DD><P>Warn whenever an object of larger than <I>len</I> bytes is defined.
</P><DT><P><B>-Wpointer-arith</B></P><DD><P>Warn about anything that depends on the "size of" a function type or
of <CODE><A HREF="keywords.html#void">void</A></CODE>. GNU C assigns these types a size of 1, for
convenience in calculations with <CODE>void*</CODE> pointers and pointers
to functions.
</P><DT><P><B>-Wbad-function-cast</B></P><DD><P>Warn whenever a function call is cast to a non-matching type.
For example, warn if <CODE>int malloc()</CODE> is cast to <CODE>anything *</CODE>.
</P><DT><P><B>-Wcast-qual</B></P><DD><P>Warn whenever a pointer is cast so as to remove a type qualifier from
the target type. For example, warn if a <CODE>const char *</CODE> is cast
to an ordinary <CODE>char *</CODE>.
</P><DT><P><B>-Wcast-align</B></P><DD><P>Warn whenever a pointer is cast such that the required alignment of the
target is increased. For example, warn if a <CODE>char *</CODE> is cast to
an <CODE>int *</CODE> on machines where integers can only be accessed at
two- or four-byte boundaries.
</P><DT><P><B>-Wwrite-strings</B></P><DD><P>When compiling C, give string constants the type <CODE>const
char[<I>length</I>]</CODE> so that
copying the address of one into a non-<CODE>const</CODE> <CODE>char *</CODE>
pointer will get a warning; when compiling C++, warn about the
deprecated conversion from string constants to <CODE>char *</CODE>.
These warnings will help you find at
compile time code that can try to write into a string constant, but
only if you have been very careful about using <CODE>const</CODE> in
declarations and prototypes. Otherwise, it will just be a nuisance;
this is why we did not make <B>'-Wall'</B> request these warnings.
</P><DT><P><B>-Wconversion</B></P><DD><P>Warn if a prototype causes a type conversion that is different from what
would happen to the same argument in the absence of a prototype. This
includes conversions of fixed point to floating and vice versa, and
conversions changing the width or signedness of a fixed point argument
except when the same as the default promotion.
<BR><BR>
Also, warn if a negative integer constant expression is implicitly
converted to an unsigned type. For example, warn about the assignment
<CODE>x = -1</CODE> if <CODE>x</CODE> is unsigned. But do not warn about explicit
casts like <CODE>(unsigned) -1</CODE>.
</P><DT><P><B>-Wsign-compare</B></P><DD><P>Warn when a comparison between signed and unsigned values could produce
an incorrect result when the signed value is converted to unsigned.
This warning is enabled by <B>'-W'</B>, and by <B>'-Wall'</B>
in C++ only.
</P><DT><P><B>-Waggregate-return</B></P><DD><P>Warn if any functions that return structures or unions are defined or
called.
</P><DT><P><B>-Wstrict-prototypes</B></P><DD><P>Warn if a function is declared or defined without specifying the
argument types. (An old-style function definition is permitted without
a warning if preceded by a declaration which specifies the argument
types.)
</P><DT><P><B>-Wmissing-prototypes</B></P><DD><P>Warn if a global function is defined without a previous prototype
declaration. This warning is issued even if the definition itself
provides a prototype. The aim is to detect global functions that fail
to be declared in header files.
</P><DT><P><B>-Wmissing-declarations (C only)</B></P><DD><P>Warn if a global function is defined without a previous declaration.
Do so even if the definition itself provides a prototype.
Use this option to detect global functions that are not declared in
header files.
</P><DT><P><B>-Wmissing-noreturn</B></P><DD><P>Warn about functions which might be candidates for attribute <A HREF="gnuexts.html#SEC85_noreturn">noreturn</A>.
Note these are only possible candidates, not absolute ones. Care should
be taken to manually verify functions actually do not ever return before
adding the <A HREF="gnuexts.html#SEC85_noreturn">noreturn</A> attribute, otherwise subtle code generation
bugs could be introduced.
</P><DT><P><B>-Wmissing-format-attribute</B></P><DD><P>If <B>'-Wformat'</B> is enabled, also warn about functions which might be
candidates for <A HREF="gnuexts.html#SEC85_format">format</A> attributes. Note these are only possible
candidates, not absolute ones. GCC will guess that <A HREF="gnuexts.html#SEC85_format">format</A>
attributes might be appropriate for any function that calls a function
like <A HREF="stdio.html#vprintf">vprintf</A> or <A HREF="stdio.html#vscanf">vscanf</A>, but this might not always be the
case, and some functions for which <A HREF="gnuexts.html#SEC85_format">format</A> attributes are
appropriate may not be detected. This option has no effect unless
<B>'-Wformat'</B> is enabled (possibly by <B>'-Wall'</B>).
</P><DT><P><B>-Wno-multichar</B></P><DD><P>Do not warn if a multicharacter constant (<CODE>'FOOF'</CODE>) is used.
Usually they indicate a typo in the user's code, as they have
implementation-defined values, and should not be used in portable code.
</P><DT><P><B>-Wno-deprecated-declarations</B></P><DD><P>Do not warn about uses of functions, variables, and types marked as
deprecated by using the <A HREF="gnuexts.html#SEC85_deprecated">deprecated</A> attribute.
</P><DT><P><B>-Wpacked</B></P><DD><P>Warn if a structure is given the <A HREF="gnuexts.html#SEC92_packed">packed</A> attribute, but the <A HREF="gnuexts.html#SEC92_packed">packed</A>