annotate man/standards.texi @ 28:1917ad0d78d7 r19-15b97

Import from CVS: tag r19-15b97
author cvs
date Mon, 13 Aug 2007 08:51:55 +0200
parents 376386a54a3c
children c9fe270a4101
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 @c %**start of header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 @setfilename standards.info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 @settitle GNU Coding Standards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 @c UPDATE THIS DATE WHENEVER YOU MAKE CHANGES!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 @set lastupdate 17 May 1996
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 @c %**end of header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 @format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 START-INFO-DIR-ENTRY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 * Standards: (standards). GNU coding standards.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 END-INFO-DIR-ENTRY
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 @end format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 @c @setchapternewpage odd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 @setchapternewpage off
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 @c This is used by a cross ref in make-stds.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 @set CODESTD 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 @iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 @set CHAPTER chapter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 @end iftex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 @set CHAPTER node
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 GNU Coding Standards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 Permission is granted to make and distribute verbatim copies of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 this manual provided the copyright notice and this permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 are preserved on all copies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 @ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 Permission is granted to process this file through TeX and print the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 results, provided the printed document carries copying permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 notice identical to this one except for the removal of this paragraph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (this paragraph not being relevant to the printed manual).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 @end ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 Permission is granted to copy and distribute modified versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 manual under the conditions for verbatim copying, provided that the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 resulting derived work is distributed under the terms of a permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 notice identical to this one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 Permission is granted to copy and distribute translations of this manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 into another language, under the above conditions for modified versions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 except that this permission notice may be stated in a translation approved
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 by the Free Software Foundation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 @titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 @title GNU Coding Standards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 @author Richard Stallman
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 @author last updated @value{lastupdate}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 @page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 @vskip 0pt plus 1filll
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 Copyright @copyright{} 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 Permission is granted to make and distribute verbatim copies of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 this manual provided the copyright notice and this permission notice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 are preserved on all copies.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 Permission is granted to copy and distribute modified versions of this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 manual under the conditions for verbatim copying, provided that the entire
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 resulting derived work is distributed under the terms of a permission
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 notice identical to this one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 Permission is granted to copy and distribute translations of this manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 into another language, under the above conditions for modified versions,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 except that this permission notice may be stated in a translation approved
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 by the Free Software Foundation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 @end titlepage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 @ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 @node Top, Preface, (dir), (dir)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 @top Version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 Last updated @value{lastupdate}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 @end ifinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 * Preface:: About the GNU Coding Standards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 * Intellectual Property:: Keeping Free Software Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 * Design Advice:: General Program Design
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 * Program Behavior:: Program Behavior for All Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 * Writing C:: Making The Best Use of C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 * Documentation:: Documenting Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 * Managing Releases:: The Release Process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 @node Preface
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 @chapter About the GNU Coding Standards
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 The GNU Coding Standards were written by Richard Stallman and other GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 Project volunteers. Their purpose is to make the GNU system clean,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 consistent, and easy to install. This document can also be read as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 guide to writing portable, robust and reliable programs. It focuses on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 programs written in C, but many of the rules and principles are useful
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 even if you write in another programming language. The rules often
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 state reasons for writing in a certain way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 Corrections or suggestions regarding this document should be sent to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 @code{gnu@@prep.ai.mit.edu}. If you make a suggestion, please include a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 suggested new wording for it; our time is limited. We prefer a context
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 diff to the @file{standards.texi} or @file{make-stds.texi} files, but if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 you don't have those files, please mail your suggestion anyway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 This release of the GNU Coding Standards was last updated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 @value{lastupdate}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 @node Intellectual Property
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 @chapter Keeping Free Software Free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 This @value{CHAPTER} discusses how you can make sure that GNU software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 remains unencumbered.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 * Reading Non-Free Code:: Referring to Proprietary Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 * Contributions:: Accepting Contributions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 @node Reading Non-Free Code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 @section Referring to Proprietary Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 Don't in any circumstances refer to Unix source code for or during
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 your work on GNU! (Or to any other proprietary programs.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 If you have a vague recollection of the internals of a Unix program,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 this does not absolutely mean you can't write an imitation of it, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 do try to organize the imitation internally along different lines,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 because this is likely to make the details of the Unix version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 irrelevant and dissimilar to your results.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 For example, Unix utilities were generally optimized to minimize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 memory use; if you go for speed instead, your program will be very
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 different. You could keep the entire input file in core and scan it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 there instead of using stdio. Use a smarter algorithm discovered more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 recently than the Unix program. Eliminate use of temporary files. Do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 it in one pass instead of two (we did this in the assembler).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 Or, on the contrary, emphasize simplicity instead of speed. For some
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 applications, the speed of today's computers makes simpler algorithms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 adequate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 Or go for generality. For example, Unix programs often have static
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 tables or fixed-size strings, which make for arbitrary limits; use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 dynamic allocation instead. Make sure your program handles NULs and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 other funny characters in the input files. Add a programming language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 for extensibility and write part of the program in that language.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 Or turn some parts of the program into independently usable libraries.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 Or use a simple garbage collector instead of tracking precisely when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 to free memory, or use a new GNU facility such as obstacks.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 @node Contributions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 @section Accepting Contributions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 If someone else sends you a piece of code to add to the program you are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 working on, we need legal papers to use it---the same sort of legal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 papers we will need to get from you. @emph{Each} significant
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 contributor to a program must sign some sort of legal papers in order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 for us to have clear title to the program. The main author alone is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 enough.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 So, before adding in any contributions from other people, tell us
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 so we can arrange to get the papers. Then wait until we tell you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 that we have received the signed papers, before you actually use the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 contribution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 This applies both before you release the program and afterward. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 you receive diffs to fix a bug, and they make significant changes, we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 need legal papers for it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 You don't need papers for changes of a few lines here or there, since
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 they are not significant for copyright purposes. Also, you don't need
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 papers if all you get from the suggestion is some ideas, not actual code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 which you use. For example, if you write a different solution to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 problem, you don't need to get papers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 We know this is frustrating; it's frustrating for us as well. But if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 you don't wait, you are going out on a limb---for example, what if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 contributor's employer won't sign a disclaimer? You might have to take
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 that code out again!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 The very worst thing is if you forget to tell us about the other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 contributor. We could be very embarrassed in court some day as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 result.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 @node Design Advice
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 @chapter General Program Design
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 This @value{CHAPTER} discusses some of the issues you should take into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 account when designing your program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 * Compatibility:: Compatibility with other implementations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 * Using Extensions:: Using non-standard features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 * ANSI C:: Using ANSI C features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 * Source Language:: Using languages other than C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 @node Compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 @section Compatibility with Other Implementations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 With occasional exceptions, utility programs and libraries for GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 should be upward compatible with those in Berkeley Unix, and upward
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 compatible with @sc{ansi} C if @sc{ansi} C specifies their behavior, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 upward compatible with @sc{POSIX} if @sc{POSIX} specifies their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 behavior.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 When these standards conflict, it is useful to offer compatibility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 modes for each of them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 @sc{ansi} C and @sc{POSIX} prohibit many kinds of extensions. Feel free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 to make the extensions anyway, and include a @samp{--ansi},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 @samp{--posix}, or @samp{--compatible} option to turn them off.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 However, if the extension has a significant chance of breaking any real
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 programs or scripts, then it is not really upward compatible. Try to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 redesign its interface.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 Many GNU programs suppress extensions that conflict with POSIX if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 environment variable @code{POSIXLY_CORRECT} is defined (even if it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 defined with a null value). Please make your program recognize this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 variable if appropriate.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 When a feature is used only by users (not by programs or command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 files), and it is done poorly in Unix, feel free to replace it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 completely with something totally different and better. (For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 @code{vi} is replaced with Emacs.) But it is nice to offer a compatible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 feature as well. (There is a free @code{vi} clone, so we offer it.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 Additional useful features not in Berkeley Unix are welcome.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 Additional programs with no counterpart in Unix may be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 but our first priority is usually to duplicate what Unix already
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 has.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 @node Using Extensions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 @section Using Non-standard Features
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 Many GNU facilities that already exist support a number of convenient
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 extensions over the comparable Unix facilities. Whether to use these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 extensions in implementing your program is a difficult question.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 On the one hand, using the extensions can make a cleaner program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 On the other hand, people will not be able to build the program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 unless the other GNU tools are available. This might cause the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 program to work on fewer kinds of machines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 With some extensions, it might be easy to provide both alternatives.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 For example, you can define functions with a ``keyword'' @code{INLINE}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 and define that as a macro to expand into either @code{inline} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 nothing, depending on the compiler.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 In general, perhaps it is best not to use the extensions if you can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 straightforwardly do without them, but to use the extensions if they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 are a big improvement.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 An exception to this rule are the large, established programs (such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 Emacs) which run on a great variety of systems. Such programs would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 be broken by use of GNU extensions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 Another exception is for programs that are used as part of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 compilation: anything that must be compiled with other compilers in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 order to bootstrap the GNU compilation facilities. If these require
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 the GNU compiler, then no one can compile them without having them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 installed already. That would be no good.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 @node ANSI C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 @section @sc{ansi} C and pre-@sc{ansi} C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 Do not ever use the ``trigraph'' feature of @sc{ansi} C.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 @sc{ansi} C is widespread enough now that it is ok to write new programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 that use @sc{ansi} C features (and therefore will not work in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 non-@sc{ansi} compilers). And if a program is already written in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 @sc{ansi} C, there's no need to convert it to support non-@sc{ansi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 compilers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 However, it is easy to support non-@sc{ansi} compilers in most programs,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 so you might still consider doing so when you write a program. Instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 of writing function definitions in @sc{ansi} prototype form,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 foo (int x, int y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 write the definition in pre-@sc{ansi} style like this,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 foo (x, y)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 int x, y;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 and use a separate declaration to specify the argument prototype:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 int foo (int, int);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 You need such a declaration anyway, in a header file, to get the benefit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 of @sc{ansi} C prototypes in all the files where the function is called.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 And once you have it, you lose nothing by writing the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 definition in the pre-@sc{ansi} style.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 If you don't know non-@sc{ansi} C, there's no need to learn it; just
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 write in @sc{ansi} C.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 @node Source Language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 @section Using Languages Other Than C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 Using a language other than C is like using a non-standard feature: it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 will cause trouble for users. Even if GCC supports the other language,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 users may find it inconvenient to have to install the compiler for that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 other language in order to build your program. So please write in C.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 There are three exceptions for this rule:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 It is okay to use a special language if the same program contains an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 interpreter for that language.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 For example, if your program links with GUILE, it is ok to write part of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 the program in Scheme or another language supported by GUILE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 It is okay to use another language in a tool specifically intended for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 use with that language.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 This is okay because the only people who want to build the tool will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 those who have installed the other language anyway.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 If an application is not of extremely widespread interest, then perhaps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 it's not important if the application is inconvenient to install.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 @node Program Behavior
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 @chapter Program Behavior for All Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 This @value{CHAPTER} describes how to write robust software. It also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 describes general standards for error messages, the command line interface,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 and how libraries should behave.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 * Semantics:: Writing robust programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 * Libraries:: Library behavior
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 * Errors:: Formatting error messages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 * User Interfaces:: Standards for command line interfaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 * Memory Usage:: When and how to care about memory needs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 @node Semantics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 @section Writing Robust Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 Avoid arbitrary limits on the length or number of @emph{any} data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 structure, including file names, lines, files, and symbols, by allocating
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 all data structures dynamically. In most Unix utilities, ``long lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 are silently truncated''. This is not acceptable in a GNU utility.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 Utilities reading files should not drop NUL characters, or any other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 nonprinting characters @emph{including those with codes above 0177}. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 only sensible exceptions would be utilities specifically intended for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 interface to certain types of printers that can't handle those characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 Check every system call for an error return, unless you know you wish to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 ignore errors. Include the system error text (from @code{perror} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 equivalent) in @emph{every} error message resulting from a failing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 system call, as well as the name of the file if any and the name of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 utility. Just ``cannot open foo.c'' or ``stat failed'' is not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 sufficient.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 Check every call to @code{malloc} or @code{realloc} to see if it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 returned zero. Check @code{realloc} even if you are making the block
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 smaller; in a system that rounds block sizes to a power of 2,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 @code{realloc} may get a different block if you ask for less space.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 In Unix, @code{realloc} can destroy the storage block if it returns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 zero. GNU @code{realloc} does not have this bug: if it fails, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 original block is unchanged. Feel free to assume the bug is fixed. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 you wish to run your program on Unix, and wish to avoid lossage in this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 case, you can use the GNU @code{malloc}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 You must expect @code{free} to alter the contents of the block that was
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 freed. Anything you want to fetch from the block, you must fetch before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 calling @code{free}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 If @code{malloc} fails in a noninteractive program, make that a fatal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 error. In an interactive program (one that reads commands from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 user), it is better to abort the command and return to the command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 reader loop. This allows the user to kill other processes to free up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 virtual memory, and then try the command again.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 Use @code{getopt_long} to decode arguments, unless the argument syntax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 makes this unreasonable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 When static storage is to be written in during program execution, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 explicit C code to initialize it. Reserve C initialized declarations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 for data that will not be changed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 @c ADR: why?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 Try to avoid low-level interfaces to obscure Unix data structures (such
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 as file directories, utmp, or the layout of kernel memory), since these
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 are less likely to work compatibly. If you need to find all the files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 in a directory, use @code{readdir} or some other high-level interface.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 These will be supported compatibly by GNU.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 By default, the GNU system will provide the signal handling functions of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 @sc{BSD} and of @sc{POSIX}. So GNU software should be written to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 these.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 In error checks that detect ``impossible'' conditions, just abort.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 There is usually no point in printing any message. These checks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 indicate the existence of bugs. Whoever wants to fix the bugs will have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 to read the source code and run a debugger. So explain the problem with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428 comments in the source. The relevant data will be in variables, which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 are easy to examine with the debugger, so there is no point moving them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 elsewhere.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 Do not use a count of errors as the exit status for a program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 @emph{That does not work}, because exit status values are limited to 8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 bits (0 through 255). A single run of the program might have 256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 errors; if you try to return 256 as the exit status, the parent process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 will see 0 as the status, and it will appear that the program succeeded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 If you make temporary files, check the @code{TMPDIR} environment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 variable; if that variable is defined, use the specified directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 instead of @file{/tmp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 @node Libraries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 @section Library Behavior
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 Try to make library functions reentrant. If they need to do dynamic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 storage allocation, at least try to avoid any nonreentrancy aside from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 that of @code{malloc} itself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 Here are certain name conventions for libraries, to avoid name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 conflicts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 Choose a name prefix for the library, more than two characters long.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 All external function and variable names should start with this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 prefix. In addition, there should only be one of these in any given
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 library member. This usually means putting each one in a separate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 source file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 An exception can be made when two external symbols are always used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 together, so that no reasonable program could use one without the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 other; then they can both go in the same file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 External symbols that are not documented entry points for the user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 should have names beginning with @samp{_}. They should also contain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 the chosen name prefix for the library, to prevent collisions with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 other libraries. These can go in the same files with user entry
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 points if you like.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 Static functions and variables can be used as you like and need not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 fit any naming convention.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 @node Errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 @section Formatting Error Messages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 Error messages from compilers should look like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 @var{source-file-name}:@var{lineno}: @var{message}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 Error messages from other noninteractive programs should look like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 @var{program}:@var{source-file-name}:@var{lineno}: @var{message}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487 when there is an appropriate source file, or like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 @var{program}: @var{message}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 when there is no relevant source file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 In an interactive program (one that is reading commands from a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 terminal), it is better not to include the program name in an error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 message. The place to indicate which program is running is in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 prompt or with the screen layout. (When the same program runs with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 input from a source other than a terminal, it is not interactive and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 would do best to print error messages using the noninteractive style.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 The string @var{message} should not begin with a capital letter when
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 it follows a program name and/or file name. Also, it should not end
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 with a period.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 Error messages from interactive programs, and other messages such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 usage messages, should start with a capital letter. But they should not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 end with a period.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511 @node User Interfaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 @section Standards for Command Line Interfaces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 Please don't make the behavior of a utility depend on the name used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 to invoke it. It is useful sometimes to make a link to a utility
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 with a different name, and that should not change what it does.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 Instead, use a run time option or a compilation switch or both
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 to select among the alternate behaviors.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521 Likewise, please don't make the behavior of the program depend on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 type of output device it is used with. Device independence is an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 important principle of the system's design; do not compromise it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 merely to save someone from typing an option now and then.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526 If you think one behavior is most useful when the output is to a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 terminal, and another is most useful when the output is a file or a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 pipe, then it is usually best to make the default behavior the one that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 is useful with output to a terminal, and have an option for the other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 behavior.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 Compatibility requires certain programs to depend on the type of output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 device. It would be disastrous if @code{ls} or @code{sh} did not do so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 in the way all users expect. In some of these cases, we supplement the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 program with a preferred alternate version that does not depend on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 output device type. For example, we provide a @code{dir} program much
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 like @code{ls} except that its default output format is always
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 multi-column format.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 It is a good idea to follow the @sc{POSIX} guidelines for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 command-line options of a program. The easiest way to do this is to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542 @code{getopt} to parse them. Note that the GNU version of @code{getopt}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 will normally permit options anywhere among the arguments unless the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 special argument @samp{--} is used. This is not what @sc{POSIX}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 specifies; it is a GNU extension.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 Please define long-named options that are equivalent to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 single-letter Unix-style options. We hope to make GNU more user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549 friendly this way. This is easy to do with the GNU function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550 @code{getopt_long}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 One of the advantages of long-named options is that they can be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 consistent from program to program. For example, users should be able
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 to expect the ``verbose'' option of any GNU program which has one, to be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 spelled precisely @samp{--verbose}. To achieve this uniformity, look at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 the table of common long-option names when you choose the option names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 for your program. The table appears below.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 If you use names not already in the table, please send
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 @samp{gnu@@prep.ai.mit.edu} a list of them, with their meanings, so we
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 can update the table.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 It is usually a good idea for file names given as ordinary arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 to be input files only; any output files would be specified using
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 options (preferably @samp{-o}). Even if you allow an output file name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 as an ordinary argument for compatibility, try to provide a suitable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 option as well. This will lead to more consistency among GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 utilities, so that there are fewer idiosyncracies for users to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 remember.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 Programs should support an option @samp{--version} which prints the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 program's version number on standard output and exits successfully, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 an option @samp{--help} which prints option usage information on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 standard output and exits successfully. These options should inhibit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 the normal function of the command; they should do nothing except print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 the requested information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 @c Please leave newlines between items in this table; it's much easier
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 @c to update when it isn't completely squashed together and unreadable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 @c When there is more than one short option for a long option name, put
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 @c a semicolon between the lists of the programs that use them, not a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 @c period. --friedman
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584 Here is the table of long options used by GNU programs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
586 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
588 @item after-date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
589 @samp{-N} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
591 @item all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
592 @samp{-a} in @code{du}, @code{ls}, @code{nm}, @code{stty}, @code{uname},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 and @code{unexpand}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 @item all-text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 @samp{-a} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 @item almost-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 @samp{-A} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 @item append
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
602 @samp{-a} in @code{etags}, @code{tee}, @code{time};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
603 @samp{-r} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
604
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
605 @item archive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
606 @samp{-a} in @code{cp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
607
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
608 @item archive-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
609 @samp{-n} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
610
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
611 @item arglength
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
612 @samp{-l} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
613
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
614 @item ascii
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
615 @samp{-a} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
616
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
617 @item assign
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
618 @samp{-v} in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
619
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
620 @item assume-new
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
621 @samp{-W} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
622
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
623 @item assume-old
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
624 @samp{-o} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
626 @item auto-check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
627 @samp{-a} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
628
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
629 @item auto-pager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
630 @samp{-a} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
632 @item auto-reference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
633 @samp{-A} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
634
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
635 @item avoid-wraps
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
636 @samp{-n} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
637
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
638 @item backward-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
639 @samp{-B} in @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
640
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
641 @item basename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
642 @samp{-f} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
643
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
644 @item batch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
645 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
647 @item baud
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
648 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
649
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
650 @item before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
651 @samp{-b} in @code{tac}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
652
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
653 @item binary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
654 @samp{-b} in @code{cpio} and @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
655
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
656 @item bits-per-code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
657 @samp{-b} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
658
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
659 @item block-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
660 Used in @code{cpio} and @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
661
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
662 @item blocks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
663 @samp{-b} in @code{head} and @code{tail}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
665 @item break-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
666 @samp{-b} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
668 @item brief
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
669 Used in various programs to make output shorter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
671 @item bytes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
672 @samp{-c} in @code{head}, @code{split}, and @code{tail}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
674 @item c@t{++}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
675 @samp{-C} in @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
676
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
677 @item catenate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
678 @samp{-A} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
679
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
680 @item cd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
681 Used in various programs to specify the directory to use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
683 @item changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
684 @samp{-c} in @code{chgrp} and @code{chown}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
685
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
686 @item classify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
687 @samp{-F} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
688
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
689 @item colons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
690 @samp{-c} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
691
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
692 @item command
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
693 @samp{-c} in @code{su};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
694 @samp{-x} in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
695
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
696 @item compare
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
697 @samp{-d} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
699 @item compat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
700 Used in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
701
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
702 @item compress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
703 @samp{-Z} in @code{tar} and @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
704
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
705 @item concatenate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
706 @samp{-A} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
708 @item confirmation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
709 @samp{-w} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
711 @item context
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
712 Used in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
713
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
714 @item copyleft
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
715 @samp{-W copyleft} in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
716
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
717 @item copyright
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
718 @samp{-C} in @code{ptx}, @code{recode}, and @code{wdiff};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
719 @samp{-W copyright} in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
720
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
721 @item core
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
722 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
723
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
724 @item count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
725 @samp{-q} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
727 @item count-links
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
728 @samp{-l} in @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
729
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
730 @item create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
731 Used in @code{tar} and @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
732
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
733 @item cut-mark
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
734 @samp{-c} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
735
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
736 @item cxref
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
737 @samp{-x} in @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
738
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
739 @item date
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
740 @samp{-d} in @code{touch}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
741
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
742 @item debug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
743 @samp{-d} in Make and @code{m4};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
744 @samp{-t} in Bison.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
745
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
746 @item define
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
747 @samp{-D} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
748
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
749 @item defines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
750 @samp{-d} in Bison and @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
751
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
752 @item delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
753 @samp{-D} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
754
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
755 @item dereference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
756 @samp{-L} in @code{chgrp}, @code{chown}, @code{cpio}, @code{du},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
757 @code{ls}, and @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
759 @item dereference-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
760 @samp{-D} in @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
761
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
762 @item diacritics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
763 @samp{-d} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
765 @item dictionary-order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
766 @samp{-d} in @code{look}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
767
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
768 @item diff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
769 @samp{-d} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
770
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
771 @item digits
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
772 @samp{-n} in @code{csplit}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
773
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
774 @item directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
775 Specify the directory to use, in various programs. In @code{ls}, it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
776 means to show directories themselves rather than their contents. In
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
777 @code{rm} and @code{ln}, it means to not treat links to directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
778 specially.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
779
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
780 @item discard-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
781 @samp{-x} in @code{strip}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
783 @item discard-locals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
784 @samp{-X} in @code{strip}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
785
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
786 @item dry-run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
787 @samp{-n} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
789 @item ed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
790 @samp{-e} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
791
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
792 @item elide-empty-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
793 @samp{-z} in @code{csplit}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
794
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
795 @item end-delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
796 @samp{-x} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
797
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
798 @item end-insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
799 @samp{-z} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
800
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
801 @item entire-new-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
802 @samp{-N} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
804 @item environment-overrides
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
805 @samp{-e} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
806
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
807 @item eof
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
808 @samp{-e} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
809
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
810 @item epoch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
811 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
812
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
813 @item error-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
814 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
815
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
816 @item error-output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
817 @samp{-o} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
818
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
819 @item escape
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
820 @samp{-b} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
822 @item exclude-from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
823 @samp{-X} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
824
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
825 @item exec
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
826 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
827
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
828 @item exit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
829 @samp{-x} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
830
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
831 @item exit-0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
832 @samp{-e} in @code{unshar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
833
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
834 @item expand-tabs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
835 @samp{-t} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
836
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
837 @item expression
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
838 @samp{-e} in @code{sed}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
839
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
840 @item extern-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
841 @samp{-g} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
843 @item extract
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
844 @samp{-i} in @code{cpio};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
845 @samp{-x} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
846
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
847 @item faces
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
848 @samp{-f} in @code{finger}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
849
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
850 @item fast
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
851 @samp{-f} in @code{su}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
852
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
853 @item fatal-warnings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
854 @samp{-E} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
855
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
856 @item file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
857 @samp{-f} in @code{info}, @code{gawk}, Make, @code{mt}, and @code{tar};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
858 @samp{-n} in @code{sed};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
859 @samp{-r} in @code{touch}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
860
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
861 @item field-separator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
862 @samp{-F} in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
863
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
864 @item file-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
865 @samp{-b} in Bison.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
867 @item file-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
868 @samp{-F} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
870 @item files-from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
871 @samp{-T} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
872
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
873 @item fill-column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
874 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
875
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
876 @item flag-truncation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
877 @samp{-F} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
878
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
879 @item fixed-output-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
880 @samp{-y} in Bison.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
881
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
882 @item follow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
883 @samp{-f} in @code{tail}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
884
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
885 @item footnote-style
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
886 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
887
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
888 @item force
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
889 @samp{-f} in @code{cp}, @code{ln}, @code{mv}, and @code{rm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
890
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
891 @item force-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
892 @samp{-F} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
893
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
894 @item format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
895 Used in @code{ls}, @code{time}, and @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
896
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
897 @item freeze-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
898 @samp{-F} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
899
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
900 @item fullname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
901 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
902
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
903 @item gap-size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
904 @samp{-g} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
905
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
906 @item get
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
907 @samp{-x} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
908
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
909 @item graphic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
910 @samp{-i} in @code{ul}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
911
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
912 @item graphics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
913 @samp{-g} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
915 @item group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
916 @samp{-g} in @code{install}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
918 @item gzip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
919 @samp{-z} in @code{tar} and @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
920
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
921 @item hashsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
922 @samp{-H} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
923
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
924 @item header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
925 @samp{-h} in @code{objdump} and @code{recode}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
926
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
927 @item heading
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
928 @samp{-H} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
930 @item help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
931 Used to ask for brief usage information.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
932
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
933 @item here-delimiter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
934 @samp{-d} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
935
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
936 @item hide-control-chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
937 @samp{-q} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
938
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
939 @item idle
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
940 @samp{-u} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
941
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
942 @item ifdef
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
943 @samp{-D} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
944
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
945 @item ignore
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
946 @samp{-I} in @code{ls};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
947 @samp{-x} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
949 @item ignore-all-space
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
950 @samp{-w} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
951
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
952 @item ignore-backups
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
953 @samp{-B} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
954
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
955 @item ignore-blank-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
956 @samp{-B} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
957
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
958 @item ignore-case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
959 @samp{-f} in @code{look} and @code{ptx};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
960 @samp{-i} in @code{diff} and @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
962 @item ignore-errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
963 @samp{-i} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
964
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
965 @item ignore-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
966 @samp{-i} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
967
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
968 @item ignore-indentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
969 @samp{-I} in @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
970
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
971 @item ignore-init-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
972 @samp{-f} in Oleo.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
973
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
974 @item ignore-interrupts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
975 @samp{-i} in @code{tee}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
976
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
977 @item ignore-matching-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
978 @samp{-I} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
979
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
980 @item ignore-space-change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
981 @samp{-b} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
983 @item ignore-zeros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
984 @samp{-i} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
985
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
986 @item include
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
987 @samp{-i} in @code{etags};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
988 @samp{-I} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
990 @item include-dir
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
991 @samp{-I} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
992
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
993 @item incremental
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
994 @samp{-G} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
995
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
996 @item info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
997 @samp{-i}, @samp{-l}, and @samp{-m} in Finger.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
998
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
999 @item initial
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1000 @samp{-i} in @code{expand}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1002 @item initial-tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1003 @samp{-T} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1004
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1005 @item inode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1006 @samp{-i} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1008 @item interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1009 @samp{-i} in @code{cp}, @code{ln}, @code{mv}, @code{rm};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1010 @samp{-e} in @code{m4};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1011 @samp{-p} in @code{xargs};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1012 @samp{-w} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1013
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1014 @item intermix-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1015 @samp{-p} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1016
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1017 @item jobs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1018 @samp{-j} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1019
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1020 @item just-print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1021 @samp{-n} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1022
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1023 @item keep-going
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1024 @samp{-k} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1025
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1026 @item keep-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1027 @samp{-k} in @code{csplit}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1028
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1029 @item kilobytes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1030 @samp{-k} in @code{du} and @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1031
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1032 @item language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1033 @samp{-l} in @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1035 @item less-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1036 @samp{-l} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1037
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1038 @item level-for-gzip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1039 @samp{-g} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1041 @item line-bytes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1042 @samp{-C} in @code{split}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1044 @item lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1045 Used in @code{split}, @code{head}, and @code{tail}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1046
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1047 @item link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1048 @samp{-l} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1049
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1050 @item lint
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1051 @itemx lint-old
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1052 Used in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1053
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1054 @item list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1055 @samp{-t} in @code{cpio};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1056 @samp{-l} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1057
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1058 @item list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1059 @samp{-t} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1060
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1061 @item literal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1062 @samp{-N} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1063
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1064 @item load-average
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1065 @samp{-l} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1066
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1067 @item login
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1068 Used in @code{su}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1069
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1070 @item machine
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1071 No listing of which programs already use this;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1072 someone should check to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1073 see if any actually do and tell @code{gnu@@prep.ai.mit.edu}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1074
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1075 @item macro-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1076 @samp{-M} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1078 @item mail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1079 @samp{-m} in @code{hello} and @code{uname}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1080
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1081 @item make-directories
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1082 @samp{-d} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1083
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1084 @item makefile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1085 @samp{-f} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1086
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1087 @item mapped
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1088 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1089
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1090 @item max-args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1091 @samp{-n} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1092
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1093 @item max-chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1094 @samp{-n} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1095
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1096 @item max-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1097 @samp{-l} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1099 @item max-load
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1100 @samp{-l} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1101
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1102 @item max-procs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1103 @samp{-P} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1105 @item mesg
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1106 @samp{-T} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1108 @item message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1109 @samp{-T} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1111 @item minimal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1112 @samp{-d} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1114 @item mixed-uuencode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1115 @samp{-M} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1117 @item mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1118 @samp{-m} in @code{install}, @code{mkdir}, and @code{mkfifo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1120 @item modification-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1121 @samp{-m} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1123 @item multi-volume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1124 @samp{-M} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1126 @item name-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1127 @samp{-a} in Bison.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1128
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1129 @item nesting-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1130 @samp{-L} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1131
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1132 @item net-headers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1133 @samp{-a} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1134
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1135 @item new-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1136 @samp{-W} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1138 @item no-builtin-rules
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1139 @samp{-r} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1140
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1141 @item no-character-count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1142 @samp{-w} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1144 @item no-check-existing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1145 @samp{-x} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1147 @item no-common
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1148 @samp{-3} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1150 @item no-create
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1151 @samp{-c} in @code{touch}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1153 @item no-defines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1154 @samp{-D} in @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1156 @item no-deleted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1157 @samp{-1} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1159 @item no-dereference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1160 @samp{-d} in @code{cp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1162 @item no-inserted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1163 @samp{-2} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1164
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1165 @item no-keep-going
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1166 @samp{-S} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1168 @item no-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1169 @samp{-l} in Bison.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1170
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1171 @item no-piping
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1172 @samp{-P} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1174 @item no-prof
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1175 @samp{-e} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1176
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1177 @item no-regex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1178 @samp{-R} in @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1180 @item no-sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1181 @samp{-p} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1182
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1183 @item no-split
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1184 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1186 @item no-static
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1187 @samp{-a} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1188
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1189 @item no-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1190 @samp{-E} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1191
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1192 @item no-timestamp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1193 @samp{-m} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1195 @item no-validate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1196 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1197
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1198 @item no-warn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1199 Used in various programs to inhibit warnings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1200
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1201 @item node
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1202 @samp{-n} in @code{info}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1204 @item nodename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1205 @samp{-n} in @code{uname}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1206
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1207 @item nonmatching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1208 @samp{-f} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1209
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1210 @item nstuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1211 @samp{-n} in @code{objdump}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1213 @item null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1214 @samp{-0} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1216 @item number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1217 @samp{-n} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1219 @item number-nonblank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1220 @samp{-b} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1222 @item numeric-sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1223 @samp{-n} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1224
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1225 @item numeric-uid-gid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1226 @samp{-n} in @code{cpio} and @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1228 @item nx
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1229 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1231 @item old-archive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1232 @samp{-o} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1234 @item old-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1235 @samp{-o} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1236
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1237 @item one-file-system
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1238 @samp{-l} in @code{tar}, @code{cp}, and @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1240 @item only-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1241 @samp{-o} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1242
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1243 @item only-prof
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1244 @samp{-f} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1245
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1246 @item only-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1247 @samp{-F} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1249 @item output
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1250 In various programs, specify the output file name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1252 @item output-prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1253 @samp{-o} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1254
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1255 @item override
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1256 @samp{-o} in @code{rm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1258 @item overwrite
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1259 @samp{-c} in @code{unshar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1261 @item owner
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1262 @samp{-o} in @code{install}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1264 @item paginate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1265 @samp{-l} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1267 @item paragraph-indent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1268 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1270 @item parents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1271 @samp{-p} in @code{mkdir} and @code{rmdir}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1273 @item pass-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1274 @samp{-p} in @code{ul}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1275
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1276 @item pass-through
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1277 @samp{-p} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1278
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1279 @item port
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1280 @samp{-P} in @code{finger}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1282 @item portability
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1283 @samp{-c} in @code{cpio} and @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1284
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1285 @item posix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1286 Used in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1287
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1288 @item prefix-builtins
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1289 @samp{-P} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1291 @item prefix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1292 @samp{-f} in @code{csplit}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1293
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1294 @item preserve
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1295 Used in @code{tar} and @code{cp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1296
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1297 @item preserve-environment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1298 @samp{-p} in @code{su}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1300 @item preserve-modification-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1301 @samp{-m} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1302
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1303 @item preserve-order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1304 @samp{-s} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1306 @item preserve-permissions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1307 @samp{-p} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1308
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1309 @item print
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1310 @samp{-l} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1311
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1312 @item print-chars
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1313 @samp{-L} in @code{cmp}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1314
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1315 @item print-data-base
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1316 @samp{-p} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1317
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1318 @item print-directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1319 @samp{-w} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1320
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1321 @item print-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1322 @samp{-o} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1323
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1324 @item print-symdefs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1325 @samp{-s} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1327 @item printer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1328 @samp{-p} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1330 @item prompt
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1331 @samp{-p} in @code{ed}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1333 @item query-user
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1334 @samp{-X} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1336 @item question
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1337 @samp{-q} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1338
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1339 @item quiet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1340 Used in many programs to inhibit the usual output. @strong{Note:} every
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1341 program accepting @samp{--quiet} should accept @samp{--silent} as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1342 synonym.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1344 @item quiet-unshar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1345 @samp{-Q} in @code{shar}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1347 @item quote-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1348 @samp{-Q} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1349
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1350 @item rcs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1351 @samp{-n} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1353 @item re-interval
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1354 Used in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1355
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1356 @item read-full-blocks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1357 @samp{-B} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1358
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1359 @item readnow
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1360 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1361
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1362 @item recon
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1363 @samp{-n} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1365 @item record-number
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1366 @samp{-R} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1368 @item recursive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1369 Used in @code{chgrp}, @code{chown}, @code{cp}, @code{ls}, @code{diff},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1370 and @code{rm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1372 @item reference-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1373 Used in @code{makeinfo}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1375 @item references
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1376 @samp{-r} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1378 @item regex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1379 @samp{-r} in @code{tac} and @code{etags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1381 @item release
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1382 @samp{-r} in @code{uname}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1384 @item reload-state
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1385 @samp{-R} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1387 @item relocation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1388 @samp{-r} in @code{objdump}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1390 @item rename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1391 @samp{-r} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1392
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1393 @item replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1394 @samp{-i} in @code{xargs}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1396 @item report-identical-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1397 @samp{-s} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1398
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1399 @item reset-access-time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1400 @samp{-a} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1401
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1402 @item reverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1403 @samp{-r} in @code{ls} and @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1404
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1405 @item reversed-ed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1406 @samp{-f} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1407
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1408 @item right-side-defs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1409 @samp{-R} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1410
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1411 @item same-order
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1412 @samp{-s} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1414 @item same-permissions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1415 @samp{-p} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1417 @item save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1418 @samp{-g} in @code{stty}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1420 @item se
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1421 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1422
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1423 @item sentence-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1424 @samp{-S} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1426 @item separate-dirs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1427 @samp{-S} in @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1429 @item separator
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1430 @samp{-s} in @code{tac}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1431
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1432 @item sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1433 Used by @code{recode} to chose files or pipes for sequencing passes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1434
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1435 @item shell
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1436 @samp{-s} in @code{su}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1437
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1438 @item show-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1439 @samp{-A} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1440
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1441 @item show-c-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1442 @samp{-p} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1444 @item show-ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1445 @samp{-E} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1447 @item show-function-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1448 @samp{-F} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1449
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1450 @item show-tabs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1451 @samp{-T} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1453 @item silent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1454 Used in many programs to inhibit the usual output.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1455 @strong{Note:} every program accepting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1456 @samp{--silent} should accept @samp{--quiet} as a synonym.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1457
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1458 @item size
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1459 @samp{-s} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1461 @item sort
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1462 Used in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1463
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1464 @item source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1465 @samp{-W source} in @code{gawk}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1466
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1467 @item sparse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1468 @samp{-S} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1469
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1470 @item speed-large-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1471 @samp{-H} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1473 @item split-at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1474 @samp{-E} in @code{unshar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1475
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1476 @item split-size-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1477 @samp{-L} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1478
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1479 @item squeeze-blank
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1480 @samp{-s} in @code{cat}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1481
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1482 @item start-delete
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1483 @samp{-w} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1485 @item start-insert
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1486 @samp{-y} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1488 @item starting-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1489 Used in @code{tar} and @code{diff} to specify which file within
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1490 a directory to start processing with.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1492 @item statistics
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1493 @samp{-s} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1494
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1495 @item stdin-file-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1496 @samp{-S} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1497
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1498 @item stop
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1499 @samp{-S} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1500
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1501 @item strict
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1502 @samp{-s} in @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1503
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1504 @item strip
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1505 @samp{-s} in @code{install}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1506
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1507 @item strip-all
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1508 @samp{-s} in @code{strip}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1510 @item strip-debug
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1511 @samp{-S} in @code{strip}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1512
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1513 @item submitter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1514 @samp{-s} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1515
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1516 @item suffix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1517 @samp{-S} in @code{cp}, @code{ln}, @code{mv}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1519 @item suffix-format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1520 @samp{-b} in @code{csplit}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1522 @item sum
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1523 @samp{-s} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1524
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1525 @item summarize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1526 @samp{-s} in @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1527
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1528 @item symbolic
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1529 @samp{-s} in @code{ln}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1531 @item symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1532 Used in GDB and @code{objdump}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1534 @item synclines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1535 @samp{-s} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1537 @item sysname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1538 @samp{-s} in @code{uname}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1540 @item tabs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1541 @samp{-t} in @code{expand} and @code{unexpand}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1543 @item tabsize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1544 @samp{-T} in @code{ls}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1545
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1546 @item terminal
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1547 @samp{-T} in @code{tput} and @code{ul}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1548 @samp{-t} in @code{wdiff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1550 @item text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1551 @samp{-a} in @code{diff}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1552
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1553 @item text-files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1554 @samp{-T} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1555
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1556 @item time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1557 Used in @code{ls} and @code{touch}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1558
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1559 @item to-stdout
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1560 @samp{-O} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1561
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1562 @item total
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1563 @samp{-c} in @code{du}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1564
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1565 @item touch
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1566 @samp{-t} in Make, @code{ranlib}, and @code{recode}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1568 @item trace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1569 @samp{-t} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1570
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1571 @item traditional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1572 @samp{-t} in @code{hello};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1573 @samp{-W traditional} in @code{gawk};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1574 @samp{-G} in @code{ed}, @code{m4}, and @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1576 @item tty
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1577 Used in GDB.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1578
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1579 @item typedefs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1580 @samp{-t} in @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1582 @item typedefs-and-c++
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1583 @samp{-T} in @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1585 @item typeset-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1586 @samp{-t} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1588 @item uncompress
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1589 @samp{-z} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1590
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1591 @item unconditional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1592 @samp{-u} in @code{cpio}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1594 @item undefine
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1595 @samp{-U} in @code{m4}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1596
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1597 @item undefined-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1598 @samp{-u} in @code{nm}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1599
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1600 @item update
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1601 @samp{-u} in @code{cp}, @code{ctags}, @code{mv}, @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1602
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1603 @item usage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1604 Used in @code{gawk}; same as @samp{--help}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1605
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1606 @item uuencode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1607 @samp{-B} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1608
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1609 @item vanilla-operation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1610 @samp{-V} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1611
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1612 @item verbose
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1613 Print more information about progress. Many programs support this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1614
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1615 @item verify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1616 @samp{-W} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1617
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1618 @item version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1619 Print the version number.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1620
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1621 @item version-control
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1622 @samp{-V} in @code{cp}, @code{ln}, @code{mv}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1623
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1624 @item vgrind
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1625 @samp{-v} in @code{ctags}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1626
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1627 @item volume
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1628 @samp{-V} in @code{tar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1630 @item what-if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1631 @samp{-W} in Make.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1632
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1633 @item whole-size-limit
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1634 @samp{-l} in @code{shar}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1635
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1636 @item width
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1637 @samp{-w} in @code{ls} and @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1638
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1639 @item word-regexp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1640 @samp{-W} in @code{ptx}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1641
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1642 @item writable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1643 @samp{-T} in @code{who}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1644
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1645 @item zeros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1646 @samp{-z} in @code{gprof}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1647 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1648
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1649 @node Memory Usage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1650 @section Memory Usage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1651
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1652 If it typically uses just a few meg of memory, don't bother making any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1653 effort to reduce memory usage. For example, if it is impractical for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1654 other reasons to operate on files more than a few meg long, it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1655 reasonable to read entire input files into core to operate on them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1656
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1657 However, for programs such as @code{cat} or @code{tail}, that can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1658 usefully operate on very large files, it is important to avoid using a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1659 technique that would artificially limit the size of files it can handle.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1660 If a program works by lines and could be applied to arbitrary
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1661 user-supplied input files, it should keep only a line in memory, because
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1662 this is not very hard and users will want to be able to operate on input
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1663 files that are bigger than will fit in core all at once.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1665 If your program creates complicated data structures, just make them in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1666 core and give a fatal error if @code{malloc} returns zero.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1668 @node Writing C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1669 @chapter Making The Best Use of C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1670
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1671 This @value{CHAPTER} provides advice on how best to use the C language
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1672 when writing GNU software.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1673
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1674 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1675 * Formatting:: Formatting Your Source Code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1676 * Comments:: Commenting Your Work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1677 * Syntactic Conventions:: Clean Use of C Constructs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1678 * Names:: Naming Variables and Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1679 * System Portability:: Portability between different operating systems
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1680 * CPU Portability:: Supporting the range of CPU types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1681 * System Functions:: Portability and ``standard'' library functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1682 * Internationalization:: Techniques for internationalization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1683 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1684
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1685 @node Formatting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1686 @section Formatting Your Source Code
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1688 It is important to put the open-brace that starts the body of a C
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1689 function in column zero, and avoid putting any other open-brace or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1690 open-parenthesis or open-bracket in column zero. Several tools look
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1691 for open-braces in column zero to find the beginnings of C functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1692 These tools will not work on code not formatted that way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1693
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1694 It is also important for function definitions to start the name of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1695 function in column zero. This helps people to search for function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1696 definitions, and may also help certain tools recognize them. Thus,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1697 the proper format is this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1698
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1699 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1700 static char *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1701 concat (s1, s2) /* Name starts in column zero here */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1702 char *s1, *s2;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1703 @{ /* Open brace in column zero here */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1704 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1705 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1706 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1707
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1708 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1709 or, if you want to use @sc{ansi} C, format the definition like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1710
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1711 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1712 static char *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1713 concat (char *s1, char *s2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1714 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1715 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1716 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1717 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1719 In @sc{ansi} C, if the arguments don't fit nicely on one line,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1720 split it like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1721
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1722 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1723 int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1724 lots_of_args (int an_integer, long a_long, short a_short,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1725 double a_double, float a_float)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1726 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1727 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1728
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1729 For the body of the function, we prefer code formatted like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1730
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1731 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1732 if (x < foo (y, z))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1733 haha = bar[4] + 5;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1734 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1735 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1736 while (z)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1737 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1738 haha += foo (z, z);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1739 z--;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1740 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1741 return ++x + bar ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1742 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1743 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1744
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1745 We find it easier to read a program when it has spaces before the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1746 open-parentheses and after the commas. Especially after the commas.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1748 When you split an expression into multiple lines, split it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1749 before an operator, not after one. Here is the right way:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1750
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1751 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1752 if (foo_this_is_long && bar > win (x, y, z)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1753 && remaining_condition)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1754 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1756 Try to avoid having two operators of different precedence at the same
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1757 level of indentation. For example, don't write this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1758
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1759 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1760 mode = (inmode[j] == VOIDmode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1761 || GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1762 ? outmode[j] : inmode[j]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1763 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1764
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1765 Instead, use extra parentheses so that the indentation shows the nesting:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1766
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1767 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1768 mode = ((inmode[j] == VOIDmode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1769 || (GET_MODE_SIZE (outmode[j]) > GET_MODE_SIZE (inmode[j])))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1770 ? outmode[j] : inmode[j]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1771 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1772
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1773 Insert extra parentheses so that Emacs will indent the code properly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1774 For example, the following indentation looks nice if you do it by hand,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1775 but Emacs would mess it up:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1776
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1777 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1778 v = rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1779 + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1780 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1781
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1782 But adding a set of parentheses solves the problem:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1783
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1784 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1785 v = (rup->ru_utime.tv_sec*1000 + rup->ru_utime.tv_usec/1000
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1786 + rup->ru_stime.tv_sec*1000 + rup->ru_stime.tv_usec/1000);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1787 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1788
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1789 Format do-while statements like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1791 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1792 do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1793 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1794 a = foo (a);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1795 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1796 while (a > 0);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1797 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1798
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1799 Please use formfeed characters (control-L) to divide the program into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1800 pages at logical places (but not within a function). It does not matter
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1801 just how long the pages are, since they do not have to fit on a printed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1802 page. The formfeeds should appear alone on lines by themselves.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1803
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1804
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1805 @node Comments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1806 @section Commenting Your Work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1807
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1808 Every program should start with a comment saying briefly what it is for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1809 Example: @samp{fmt - filter for simple filling of text}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1810
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1811 Please put a comment on each function saying what the function does,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1812 what sorts of arguments it gets, and what the possible values of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1813 arguments mean and are used for. It is not necessary to duplicate in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1814 words the meaning of the C argument declarations, if a C type is being
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1815 used in its customary fashion. If there is anything nonstandard about
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1816 its use (such as an argument of type @code{char *} which is really the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1817 address of the second character of a string, not the first), or any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1818 possible values that would not work the way one would expect (such as,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1819 that strings containing newlines are not guaranteed to work), be sure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1820 to say so.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1821
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1822 Also explain the significance of the return value, if there is one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1823
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1824 Please put two spaces after the end of a sentence in your comments, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1825 that the Emacs sentence commands will work. Also, please write
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1826 complete sentences and capitalize the first word. If a lower-case
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1827 identifier comes at the beginning of a sentence, don't capitalize it!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1828 Changing the spelling makes it a different identifier. If you don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1829 like starting a sentence with a lower case letter, write the sentence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1830 differently (e.g., ``The identifier lower-case is @dots{}'').
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1831
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1832 The comment on a function is much clearer if you use the argument
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1833 names to speak about the argument values. The variable name itself
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1834 should be lower case, but write it in upper case when you are speaking
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1835 about the value rather than the variable itself. Thus, ``the inode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1836 number NODE_NUM'' rather than ``an inode''.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1837
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1838 There is usually no purpose in restating the name of the function in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1839 the comment before it, because the reader can see that for himself.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1840 There might be an exception when the comment is so long that the function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1841 itself would be off the bottom of the screen.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1842
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1843 There should be a comment on each static variable as well, like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1844
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1845 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1846 /* Nonzero means truncate lines in the display;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1847 zero means continue them. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1848 int truncate_lines;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1849 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1850
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1851 Every @samp{#endif} should have a comment, except in the case of short
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1852 conditionals (just a few lines) that are not nested. The comment should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1853 state the condition of the conditional that is ending, @emph{including
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1854 its sense}. @samp{#else} should have a comment describing the condition
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1855 @emph{and sense} of the code that follows. For example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1856
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1857 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1858 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1859 #ifdef foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1860 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1861 #else /* not foo */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1862 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1863 #endif /* not foo */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1864 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1865 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1866
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1867 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1868 but, by contrast, write the comments this way for a @samp{#ifndef}:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1869
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1870 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1871 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1872 #ifndef foo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1873 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1874 #else /* foo */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1875 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1876 #endif /* foo */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1877 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1878 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1879
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1880
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1881 @node Syntactic Conventions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1882 @section Clean Use of C Constructs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1883
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1884 Please explicitly declare all arguments to functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1885 Don't omit them just because they are @code{int}s.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1886
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1887 Declarations of external functions and functions to appear later in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1888 source file should all go in one place near the beginning of the file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1889 (somewhere before the first function definition in the file), or else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1890 should go in a header file. Don't put @code{extern} declarations inside
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1891 functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1892
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1893 It used to be common practice to use the same local variables (with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1894 names like @code{tem}) over and over for different values within one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1895 function. Instead of doing this, it is better declare a separate local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1896 variable for each distinct purpose, and give it a name which is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1897 meaningful. This not only makes programs easier to understand, it also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1898 facilitates optimization by good compilers. You can also move the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1899 declaration of each local variable into the smallest scope that includes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1900 all its uses. This makes the program even cleaner.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1901
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1902 Don't use local variables or parameters that shadow global identifiers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1903
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1904 Don't declare multiple variables in one declaration that spans lines.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1905 Start a new declaration on each line, instead. For example, instead
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1906 of this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1907
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1908 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1909 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1910 int foo,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1911 bar;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1912 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1913 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1914
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1915 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1916 write either this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1917
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1918 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1919 int foo, bar;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1920 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1921
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1922 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1923 or this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1924
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1925 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1926 int foo;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1927 int bar;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1928 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1929
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1930 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1931 (If they are global variables, each should have a comment preceding it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1932 anyway.)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1933
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1934 When you have an @code{if}-@code{else} statement nested in another
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1935 @code{if} statement, always put braces around the @code{if}-@code{else}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1936 Thus, never write like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1937
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1938 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1939 if (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1940 if (bar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1941 win ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1942 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1943 lose ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1944 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1945
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1946 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1947 always like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1948
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1949 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1950 if (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1951 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1952 if (bar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1953 win ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1954 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1955 lose ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1956 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1957 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1958
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1959 If you have an @code{if} statement nested inside of an @code{else}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1960 statement, either write @code{else if} on one line, like this,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1961
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1962 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1963 if (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1964 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1965 else if (bar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1966 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1967 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1968
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1969 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1970 with its @code{then}-part indented like the preceding @code{then}-part,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1971 or write the nested @code{if} within braces like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1972
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1973 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1974 if (foo)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1975 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1976 else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1977 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1978 if (bar)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1979 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1980 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1981 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1982
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1983 Don't declare both a structure tag and variables or typedefs in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1984 same declaration. Instead, declare the structure tag separately
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1985 and then use it to declare the variables or typedefs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1986
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1987 Try to avoid assignments inside @code{if}-conditions. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1988 don't write this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1989
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1990 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1991 if ((foo = (char *) malloc (sizeof *foo)) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1992 fatal ("virtual memory exhausted");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1993 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1994
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1995 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1996 instead, write this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1997
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1998 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1999 foo = (char *) malloc (sizeof *foo);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2000 if (foo == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2001 fatal ("virtual memory exhausted");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2002 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2003
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2004 Don't make the program ugly to placate @code{lint}. Please don't insert any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2005 casts to @code{void}. Zero without a cast is perfectly fine as a null
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2006 pointer constant, except when calling a varargs function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2007
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2008 @node Names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2009 @section Naming Variables and Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2010
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2011 Please use underscores to separate words in a name, so that the Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2012 word commands can be useful within them. Stick to lower case; reserve
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2013 upper case for macros and @code{enum} constants, and for name-prefixes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2014 that follow a uniform convention.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2015
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2016 For example, you should use names like @code{ignore_space_change_flag};
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2017 don't use names like @code{iCantReadThis}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2018
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2019 Variables that indicate whether command-line options have been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2020 specified should be named after the meaning of the option, not after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2021 the option-letter. A comment should state both the exact meaning of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2022 the option and its letter. For example,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2023
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2024 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2025 @group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2026 /* Ignore changes in horizontal whitespace (-b). */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2027 int ignore_space_change_flag;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2028 @end group
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2029 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2030
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2031 When you want to define names with constant integer values, use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2032 @code{enum} rather than @samp{#define}. GDB knows about enumeration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2033 constants.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2034
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2035 Use file names of 14 characters or less, to avoid creating gratuitous
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2036 problems on older System V systems. You can use the program @code{doschk} to test for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2037 this. @code{doschk} also tests for potential name conflicts if the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2038 files were loaded onto an MS-DOS file system---something you may or may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2039 not care about.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2040
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2041 @node System Portability
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2042 @section Portability between System Types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2043
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2044 In the Unix world, ``portability'' refers to porting to different Unix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2045 versions. For a GNU program, this kind of portability is desirable, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2046 not paramount.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2047
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2048 The primary purpose of GNU software is to run on top of the GNU kernel,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2049 compiled with the GNU C compiler, on various types of @sc{cpu}. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2050 amount and kinds of variation among GNU systems on different @sc{cpu}s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2051 will be comparable to the variation among Linux-based GNU systems or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2052 among BSD systems today. So the kinds of portability that are absolutely
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2053 necessary are quite limited.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2054
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2055 But many users do run GNU software on non-GNU Unix or Unix-like systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2056 So supporting a variety of Unix-like systems is desirable, although not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2057 paramount.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2058
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2059 The easiest way to achieve portability to most Unix-like systems is to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2060 use Autoconf. It's unlikely that your program needs to know more
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2061 information about the host platform than Autoconf can provide, simply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2062 because most of the programs that need such knowledge have already been
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2063 written.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2064
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2065 Avoid using the format of semi-internal data bases (e.g., directories)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2066 when there is a higher-level alternative (@code{readdir}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2067
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2068 As for systems that are not like Unix, such as MSDOS, Windows, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2069 Macintosh, VMS, and MVS, supporting them is usually so much work that it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2070 is better if you don't.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2071
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2072 The planned GNU kernel is not finished yet, but you can tell which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2073 facilities it will provide by looking at the GNU C Library Manual. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2074 GNU kernel is based on Mach, so the features of Mach will also be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2075 available. However, if you use Mach features, you'll probably have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2076 trouble debugging your program today.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2077
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2078 @node CPU Portability
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2079 @section Portability between @sc{cpu}s
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2080
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2081 Even GNU systems will differ because of differences among @sc{cpu}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2082 types---for example, difference in byte ordering and alignment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2083 requirements. It is absolutely essential to handle these differences.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2084 However, don't make any effort to cater to the possibility that an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2085 @code{int} will be less than 32 bits. We don't support 16-bit machines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2086 in GNU.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2087
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2088 Don't assume that the address of an @code{int} object is also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2089 address of its least-significant byte. This is false on big-endian
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2090 machines. Thus, don't make the following mistake:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2091
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2092 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2093 int c;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2094 @dots{}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2095 while ((c = getchar()) != EOF)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2096 write(file_descriptor, &c, 1);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2097 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2098
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2099 When calling functions, you need not worry about the difference between
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2100 pointers of various types, or between pointers and integers. On most
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2101 machines, there's no difference anyway. As for the few machines where
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2102 there is a difference, all of them support @sc{ansi} C, so you can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2103 prototypes (conditionalized to be active only in @sc{ansi} C) to make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2104 the code work on those systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2106 In certain cases, it is ok to pass integer and pointer arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2107 indiscriminately to the same function, and use no prototype on any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2108 system. For example, many GNU programs have error-reporting functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2109 that pass their arguments along to @code{printf} and friends:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2111 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2112 error (s, a1, a2, a3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2113 char *s;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2114 int a1, a2, a3;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2115 @{
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2116 fprintf (stderr, "error: ");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2117 fprintf (stderr, s, a1, a2, a3);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2118 @}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2119 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2121 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2122 In practice, this works on all machines, and it is much simpler than any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2123 ``correct'' alternative. Be sure @emph{not} to use a prototype
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2124 for such functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2126 However, avoid casting pointers to integers unless you really need to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2127 These assumptions really reduce portability, and in most programs they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2128 are easy to avoid. In the cases where casting pointers to integers is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2129 essential---such as, a Lisp interpreter which stores type information as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2130 well as an address in one word---it is ok to do so, but you'll have to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2131 make explicit provisions to handle different word sizes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2133 @node System Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2134 @section Calling System Functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2136 C implementations differ substantially. @sc{ansi} C reduces but does not
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2137 eliminate the incompatibilities; meanwhile, many users wish to compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2138 GNU software with pre-@sc{ansi} compilers. This chapter gives
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2139 recommendations for how to use the more or less standard C library
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2140 functions to avoid unnecessary loss of portability.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2141
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2142 @itemize @bullet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2143 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2144 Don't use the value of @code{sprintf}. It returns the number of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2145 characters written on some systems, but not on all systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2147 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2148 Don't declare system functions explicitly.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2149
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2150 Almost any declaration for a system function is wrong on some system.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2151 To minimize conflicts, leave it to the system header files to declare
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2152 system functions. If the headers don't declare a function, let it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2153 remain undeclared.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2154
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2155 While it may seem unclean to use a function without declaring it, in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2156 practice this works fine for most system library functions on the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2157 systems where this really happens; thus, the disadvantage is only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2158 theoretical. By contrast, actual declarations have frequently caused
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2159 actual conflicts.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2160
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2161 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2162 If you must declare a system function, don't specify the argument types.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2163 Use an old-style declaration, not an @sc{ansi} prototype. The more you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2164 specify about the function, the more likely a conflict.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2166 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2167 In particular, don't unconditionally declare @code{malloc} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2168 @code{realloc}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2169
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2170 Most GNU programs use those functions just once, in functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2171 conventionally named @code{xmalloc} and @code{xrealloc}. These
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2172 functions call @code{malloc} and @code{realloc}, respectively, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2173 check the results.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2175 Because @code{xmalloc} and @code{xrealloc} are defined in your program,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2176 you can declare them in other files without any risk of type conflict.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2178 On most systems, @code{int} is the same length as a pointer; thus, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2179 calls to @code{malloc} and @code{realloc} work fine. For the few
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2180 exceptional systems (mostly 64-bit machines), you can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2181 @strong{conditionalized} declarations of @code{malloc} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2182 @code{realloc}---or put these declarations in configuration files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2183 specific to those systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2184
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2185 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2186 The string functions require special treatment. Some Unix systems have
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2187 a header file @file{string.h}; others have @file{strings.h}. Neither
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2188 file name is portable. There are two things you can do: use Autoconf to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2189 figure out which file to include, or don't include either file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2191 @item
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2192 If you don't include either strings file, you can't get declarations for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2193 the string functions from the header file in the usual way.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2195 That causes less of a problem than you might think. The newer @sc{ansi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2196 string functions should be avoided anyway because many systems still
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2197 don't support them. The string functions you can use are these:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2198
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2199 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2200 strcpy strncpy strcat strncat
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2201 strlen strcmp strncmp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2202 strchr strrchr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2203 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2205 The copy and concatenate functions work fine without a declaration as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2206 long as you don't use their values. Using their values without a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2207 declaration fails on systems where the width of a pointer differs from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2208 the width of @code{int}, and perhaps in other cases. It is trivial to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2209 avoid using their values, so do that.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2211 The compare functions and @code{strlen} work fine without a declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2212 on most systems, possibly all the ones that GNU software runs on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2213 You may find it necessary to declare them @strong{conditionally} on a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2214 few systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2215
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2216 The search functions must be declared to return @code{char *}. Luckily,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2217 there is no variation in the data type they return. But there is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2218 variation in their names. Some systems give these functions the names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2219 @code{index} and @code{rindex}; other systems use the names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2220 @code{strchr} and @code{strrchr}. Some systems support both pairs of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2221 names, but neither pair works on all systems.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2223 You should pick a single pair of names and use it throughout your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2224 program. (Nowadays, it is better to choose @code{strchr} and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2225 @code{strrchr} for new programs, since those are the standard @sc{ansi}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2226 names.) Declare both of those names as functions returning @code{char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2227 *}. On systems which don't support those names, define them as macros
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2228 in terms of the other pair. For example, here is what to put at the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2229 beginning of your file (or in a header) if you want to use the names
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2230 @code{strchr} and @code{strrchr} throughout:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2232 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2233 #ifndef HAVE_STRCHR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2234 #define strchr index
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2235 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2236 #ifndef HAVE_STRRCHR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2237 #define strrchr rindex
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2238 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2240 char *strchr ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2241 char *strrchr ();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2242 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2243 @end itemize
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2245 Here we assume that @code{HAVE_STRCHR} and @code{HAVE_STRRCHR} are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2246 macros defined in systems where the corresponding functions exist.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2247 One way to get them properly defined is to use Autoconf.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2249 @node Internationalization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2250 @section Internationalization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2251
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2252 GNU has a library called GNU gettext that makes it easy to translate the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2253 messages in a program into various languages. You should use this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2254 library in every program. Use English for the messages as they appear
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2255 in the program, and let gettext provide the way to translate them into
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2256 other languages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2258 Using GNU gettext involves putting a call to the @code{gettext} macro
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2259 around each string that might need translation---like this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2260
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2261 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2262 printf (gettext ("Processing file `%s'..."));
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2263 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2265 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2266 This permits GNU gettext to replace the string @code{"Processing file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2267 `%s'..."} with a translated version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2268
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2269 Once a program uses gettext, please make a point of writing calls to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2270 @code{gettext} when you add new strings that call for translation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2272 Using GNU gettext in a package involves specifying a @dfn{text domain
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2273 name} for the package. The text domain name is used to separate the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2274 translations for this package from the translations for other packages.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2275 Normally, the text domain name should be the same as the name of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2276 package---for example, @samp{fileutils} for the GNU file utilities.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2277
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2278 To enable gettext to work, avoid writing code that makes assumptions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2279 about the structure of words. Don't construct words from parts. Here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2280 is an example of what not to do:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2282 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2283 prinf ("%d file%s processed", nfiles,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2284 nfiles > 1 ? "s" : "");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2285 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2287 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2288 The problem with that example is that it assumes that plurals are made
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2289 by adding `s'. If you apply gettext to the format string, like this,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2290
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2291 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2292 prinf (gettext ("%d file%s processed"), nfiles,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2293 nfiles > 1 ? "s" : "");
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2294 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2295
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2296 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2297 the message can use different words, but it will still be forced to use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2298 `s' for the plural. Here is a better way:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2299
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2300 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2301 prinf ((nfiles > 1 ? "%d files processed"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2302 : "%d file processed"),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2303 nfiles);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2304 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2306 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2307 This way, you can apply gettext to each of the two strings
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2308 independently:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2309
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2310 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2311 prinf ((nfiles > 1 ? gettext ("%d files processed")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2312 : gettext ("%d file processed")),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2313 nfiles);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2314 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2316 @noindent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2317 This can handle any language, no matter how it forms the plural of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2318 word for ``file.''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2319
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2320 @node Documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2321 @chapter Documenting Programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2323 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2324 * GNU Manuals:: Writing proper manuals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2325 * Manual Structure Details:: Specific structure conventions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2326 * NEWS File:: NEWS files supplement manuals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2327 * Change Logs:: Recording Changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2328 * Man Pages:: Man pages are secondary.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2329 * Reading other Manuals:: How far you can go in learning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2330 from other manuals.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2331 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2333 @node GNU Manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2334 @section GNU Manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2336 The preferred way to document part of the GNU system is to write a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2337 manual in the Texinfo formatting language. See the Texinfo manual,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2338 either the hardcopy, or the on-line version available through
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2339 @code{info} or the Emacs Info subsystem (@kbd{C-h i}).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2340
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2341 The manual should document all of the program's command-line options and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2342 all of its commands. It should give examples of their use. But don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2343 organize the manual as a list of features. Instead, organize it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2344 logically, by subtopics. Address the goals that a user will have in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2345 mind, and explain how to accomplish them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2346
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2347 In general, a GNU manual should serve both as tutorial and reference.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2348 It should be set up for convenient access to each topic through Info,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2349 and for reading straight through (appendixes aside). A GNU manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2350 should give a good introduction to a beginner reading through from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2351 start, and should also provide all the details that hackers want.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2352
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2353 That is not as hard as it first sounds. Arrange each chapter as a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2354 logical breakdown of its topic, but order the sections, and write their
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2355 text, so that reading the chapter straight through makes sense. Do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2356 likewise when structuring the book into chapters, and when structuring a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2357 section into paragraphs. The watchword is, @emph{at each point, address
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2358 the most fundamental and important issue raised by the preceding text.}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2359
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2360 If necessary, add extra chapters at the beginning of the manual which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2361 are purely tutorial and cover the basics of the subject. These provide
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2362 the framework for a beginner to understand the rest of the manual. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2363 Bison manual provides a good example of how to do this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2364
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2365 Don't use Unix man pages as a model for how to write GNU documentation;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2366 they are a bad example to follow.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2367
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2368 Please do not use the term ``pathname'' that is used in Unix
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2369 documentation; use ``file name'' (two words) instead. We use the term
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2370 ``path'' only for search paths, which are lists of file names.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2372 @node Manual Structure Details
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2373 @section Manual Structure Details
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2375 The title page of the manual should state the version of the program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2376 to which the manual applies. The Top node of the manual should also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2377 contain this information. If the manual is changing more frequently
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2378 than or independent of the program, also state a version number for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2379 the manual in both of these places.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2381 The manual should have a node named @samp{@var{program} Invocation} or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2382 @samp{Invoking @var{program}}, where @var{program} stands for the name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2383 of the program being described, as you would type it in the shell to run
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2384 the program. This node (together with its subnodes, if any) should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2385 describe the program's command line arguments and how to run it (the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2386 sort of information people would look in a man page for). Start with an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2387 @samp{@@example} containing a template for all the options and arguments
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2388 that the program uses.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2389
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2390 Alternatively, put a menu item in some menu whose item name fits one of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2391 the above patterns. This identifies the node which that item points to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2392 as the node for this purpose, regardless of the node's actual name.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2394 There will be automatic features for specifying a program name and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2395 quickly reading just this part of its manual.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2396
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2397 If one manual describes several programs, it should have such a node for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2398 each program described.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2399
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2400 @node NEWS File
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2401 @section The NEWS File
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2402
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2403 In addition to its manual, the package should have a file named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2404 @file{NEWS} which contains a list of user-visible changes worth
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2405 mentioning. In each new release, add items to the front of the file and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2406 identify the version they pertain to. Don't discard old items; leave
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2407 them in the file after the newer items. This way, a user upgrading from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2408 any previous version can see what is new.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2409
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2410 If the @file{NEWS} file gets very long, move some of the older items
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2411 into a file named @file{ONEWS} and put a note at the end referring the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2412 user to that file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2413
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2414 @node Change Logs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2415 @section Change Logs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2416
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2417 Keep a change log to describe all the changes made to program source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2418 files. The purpose of this is so that people investigating bugs in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2419 future will know about the changes that might have introduced the bug.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2420 Often a new bug can be found by looking at what was recently changed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2421 More importantly, change logs can help eliminate conceptual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2422 inconsistencies between different parts of a program; they can give you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2423 a history of how the conflicting concepts arose.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2424
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2425 A change log file is normally called @file{ChangeLog} and covers an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2426 entire directory. Each directory can have its own change log, or a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2427 directory can use the change log of its parent directory--it's up to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2428 you.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2429
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2430 Another alternative is to record change log information with a version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2431 control system such as RCS or CVS. This can be converted automatically
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2432 to a @file{ChangeLog} file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2433
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2434 The easiest way to add an entry to @file{ChangeLog} is with the Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2435 command @kbd{M-x add-change-log-entry}. An entry should have an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2436 asterisk, the name of the changed file, and then in parentheses the name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2437 of the changed functions, variables or whatever, followed by a colon.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2438 Then describe the changes you made to that function or variable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2440 Separate unrelated entries with blank lines. When two entries
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2441 represent parts of the same change, so that they work together, then
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2442 don't put blank lines between them. Then you can omit the file name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2443 and the asterisk when successive entries are in the same file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2445 Here are some examples:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2447 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2448 * register.el (insert-register): Return nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2449 (jump-to-register): Likewise.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2451 * sort.el (sort-subr): Return nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2452
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2453 * tex-mode.el (tex-bibtex-file, tex-file, tex-region):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2454 Restart the tex shell if process is gone or stopped.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2455 (tex-shell-running): New function.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2456
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2457 * expr.c (store_one_arg): Round size up for move_block_to_reg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2458 (expand_call): Round up when emitting USE insns.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2459 * stmt.c (assign_parms): Round size up for move_block_from_reg.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2460 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2461
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2462 It's important to name the changed function or variable in full. Don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2463 abbreviate function or variable names, and don't combine them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2464 Subsequent maintainers will often
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2465 search for a function name to find all the change log entries that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2466 pertain to it; if you abbreviate the name, they won't find it when they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2467 search. For example, some people are tempted to abbreviate groups of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2468 function names by writing @samp{* register.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2469 (@{insert,jump-to@}-register)}; this is not a good idea, since searching
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2470 for @code{jump-to-register} or @code{insert-register} would not find the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2471 entry.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2472
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2473 There's no need to describe the full purpose of the changes or how they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2474 work together. It is better to put such explanations in comments in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2475 code. That's why just ``New function'' is enough; there is a comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2476 with the function in the source to explain what it does.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2477
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2478 However, sometimes it is useful to write one line to describe the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2479 overall purpose of a large batch of changes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2480
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2481 You can think of the change log as a conceptual ``undo list'' which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2482 explains how earlier versions were different from the current version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2483 People can see the current version; they don't need the change log
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2484 to tell them what is in it. What they want from a change log is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2485 clear explanation of how the earlier version differed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2486
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2487 When you change the calling sequence of a function in a simple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2488 fashion, and you change all the callers of the function, there is no
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2489 need to make individual entries for all the callers. Just write in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2490 the entry for the function being called, ``All callers changed.''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2492 When you change just comments or doc strings, it is enough to write an
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2493 entry for the file, without mentioning the functions. Write just,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2494 ``Doc fix.''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2496 There's no need to make change log entries for documentation files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2497 This is because documentation is not susceptible to bugs that are hard
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2498 to fix. Documentation does not consist of parts that must interact in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2499 precisely engineered fashion. To correct an error, you need not know
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2500 the history of the erroneous passage; it is enough to compare the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2501 passage with the way the program actually works.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2503 @node Man Pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2504 @section Man Pages
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2505
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2506 In the GNU project, man pages are secondary. It is not necessary or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2507 expected for every GNU program to have a man page, but some of them do.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2508 It's your choice whether to include a man page in your program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2509
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2510 When you make this decision, consider that supporting a man page
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2511 requires continual effort each time the program is changed. The time
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2512 you spend on the man page is time taken away from more useful work.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2514 For a simple program which changes little, updating the man page may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2515 a small job. Then there is little reason not to include a man page, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2516 you have one.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2517
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2518 For a large program that changes a great deal, updating a man page may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2519 be a substantial burden. If a user offers to donate a man page, you may
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2520 find this gift costly to accept. It may be better to refuse the man
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2521 page unless the same person agrees to take full responsibility for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2522 maintaining it---so that you can wash your hands of it entirely. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2523 this volunteer later ceases to do the job, then don't feel obliged to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2524 pick it up yourself; it may be better to withdraw the man page from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2525 distribution until someone else agrees to update it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2527 When a program changes only a little, you may feel that the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2528 discrepancies are small enough that the man page remains useful without
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2529 updating. If so, put a prominent note near the beginning of the man
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2530 page explaining that you don't maintain it and that the Texinfo manual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2531 is more authoritative. The note should say how to access the Texinfo
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2532 documentation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2533
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2534 @node Reading other Manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2535 @section Reading other Manuals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2536
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2537 There may be non-free books or documentation files that describe the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2538 program you are documenting.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2539
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2540 It is ok to use these documents for reference, just as the author of a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2541 new algebra textbook can read other books on algebra. A large portion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2542 of any non-fiction book consists of facts, in this case facts about how
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2543 a certain program works, and these facts are necessarily the same for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2544 everyone who writes about the subject. But be careful not to copy your
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2545 outline structure, wording, tables or examples from preexisting non-free
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2546 documentation. Copying from free documentation may be ok; please check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2547 with the FSF about the individual case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2548
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2549 @node Managing Releases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2550 @chapter The Release Process
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2551
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2552 Making a release is more than just bundling up your source files in a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2553 tar file and putting it up for FTP. You should set up your software so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2554 that it can be configured to run on a variety of systems. Your Makefile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2555 should conform to the GNU standards described below, and your directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2556 layout should also conform to the standards discussed below. Doing so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2557 makes it easy to include your package into the larger framework of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2558 all GNU software.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2559
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2560 @menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2561 * Configuration:: How Configuration Should Work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2562 * Makefile Conventions:: Makefile Conventions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2563 * Releases:: Making Releases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2564 @end menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2565
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2566 @node Configuration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2567 @section How Configuration Should Work
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2569 Each GNU distribution should come with a shell script named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2570 @code{configure}. This script is given arguments which describe the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2571 kind of machine and system you want to compile the program for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2572
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2573 The @code{configure} script must record the configuration options so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2574 that they affect compilation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2575
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2576 One way to do this is to make a link from a standard name such as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2577 @file{config.h} to the proper configuration file for the chosen system.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2578 If you use this technique, the distribution should @emph{not} contain a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2579 file named @file{config.h}. This is so that people won't be able to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2580 build the program without configuring it first.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2581
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2582 Another thing that @code{configure} can do is to edit the Makefile. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2583 you do this, the distribution should @emph{not} contain a file named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2584 @file{Makefile}. Instead, it should include a file @file{Makefile.in} which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2585 contains the input used for editing. Once again, this is so that people
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2586 won't be able to build the program without configuring it first.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2587
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2588 If @code{configure} does write the @file{Makefile}, then @file{Makefile}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2589 should have a target named @file{Makefile} which causes @code{configure}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2590 to be rerun, setting up the same configuration that was set up last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2591 time. The files that @code{configure} reads should be listed as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2592 dependencies of @file{Makefile}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2593
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2594 All the files which are output from the @code{configure} script should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2595 have comments at the beginning explaining that they were generated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2596 automatically using @code{configure}. This is so that users won't think
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2597 of trying to edit them by hand.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2598
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2599 The @code{configure} script should write a file named @file{config.status}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2600 which describes which configuration options were specified when the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2601 program was last configured. This file should be a shell script which,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2602 if run, will recreate the same configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2603
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2604 The @code{configure} script should accept an option of the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2605 @samp{--srcdir=@var{dirname}} to specify the directory where sources are found
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2606 (if it is not the current directory). This makes it possible to build
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2607 the program in a separate directory, so that the actual source directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2608 is not modified.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2609
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2610 If the user does not specify @samp{--srcdir}, then @code{configure} should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2611 check both @file{.} and @file{..} to see if it can find the sources. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2612 it finds the sources in one of these places, it should use them from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2613 there. Otherwise, it should report that it cannot find the sources, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2614 should exit with nonzero status.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2615
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2616 Usually the easy way to support @samp{--srcdir} is by editing a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2617 definition of @code{VPATH} into the Makefile. Some rules may need to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2618 refer explicitly to the specified source directory. To make this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2619 possible, @code{configure} can add to the Makefile a variable named
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2620 @code{srcdir} whose value is precisely the specified directory.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2621
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2622 The @code{configure} script should also take an argument which specifies the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2623 type of system to build the program for. This argument should look like
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2624 this:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2625
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2626 @example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2627 @var{cpu}-@var{company}-@var{system}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2628 @end example
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2629
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2630 For example, a Sun 3 might be @samp{m68k-sun-sunos4.1}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2631
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2632 The @code{configure} script needs to be able to decode all plausible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2633 alternatives for how to describe a machine. Thus, @samp{sun3-sunos4.1}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2634 would be a valid alias. For many programs, @samp{vax-dec-ultrix} would
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2635 be an alias for @samp{vax-dec-bsd}, simply because the differences
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2636 between Ultrix and @sc{BSD} are rarely noticeable, but a few programs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2637 might need to distinguish them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2638 @c Real 4.4BSD now runs on some Suns.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2639
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2640 There is a shell script called @file{config.sub} that you can use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2641 as a subroutine to validate system types and canonicalize aliases.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2642
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2643 Other options are permitted to specify in more detail the software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2644 or hardware present on the machine, and include or exclude optional
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2645 parts of the package:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2646
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2647 @table @samp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2648 @item --enable-@var{feature}@r{[}=@var{parameter}@r{]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2649 Configure the package to build and install an optional user-level
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2650 facility called @var{feature}. This allows users to choose which
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2651 optional features to include. Giving an optional @var{parameter} of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2652 @samp{no} should omit @var{feature}, if it is built by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2653
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2654 No @samp{--enable} option should @strong{ever} cause one feature to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2655 replace another. No @samp{--enable} option should ever substitute one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2656 useful behavior for another useful behavior. The only proper use for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2657 @samp{--enable} is for questions of whether to build part of the program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2658 or exclude it.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2659
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2660 @item --with-@var{package}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2661 @c @r{[}=@var{parameter}@r{]}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2662 The package @var{package} will be installed, so configure this package
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2663 to work with @var{package}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2664
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2665 @c Giving an optional @var{parameter} of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2666 @c @samp{no} should omit @var{package}, if it is used by default.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2667
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2668 Possible values of @var{package} include @samp{x}, @samp{x-toolkit},
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2669 @samp{gnu-as} (or @samp{gas}), @samp{gnu-ld}, @samp{gnu-libc}, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2670 @samp{gdb}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2671
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2672 Do not use a @samp{--with} option to specify the file name to use to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2673 find certain files. That is outside the scope of what @samp{--with}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2674 options are for.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2675
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2676 @item --nfp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2677 The target machine has no floating point processor.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2678
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2679 @item --gas
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2680 The target machine assembler is GAS, the GNU assembler.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2681 This is obsolete; users should use @samp{--with-gnu-as} instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2682
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2683 @item --x
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2684 The target machine has the X Window System installed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2685 This is obsolete; users should use @samp{--with-x} instead.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2686 @end table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2687
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2688 All @code{configure} scripts should accept all of these ``detail''
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2689 options, whether or not they make any difference to the particular
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2690 package at hand. In particular, they should accept any option that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2691 starts with @samp{--with-} or @samp{--enable-}. This is so users will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2692 be able to configure an entire GNU source tree at once with a single set
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2693 of options.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2694
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2695 You will note that the categories @samp{--with-} and @samp{--enable-}
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2696 are narrow: they @strong{do not} provide a place for any sort of option
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2697 you might think of. That is deliberate. We want to limit the possible
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2698 configuration options in GNU software. We do not want GNU programs to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2699 have idiosyncratic configuration options.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2700
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2701 Packages that perform part of the compilation process may support cross-compilation.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2702 In such a case, the host and target machines for the program may be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2703 different. The @code{configure} script should normally treat the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2704 specified type of system as both the host and the target, thus producing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2705 a program which works for the same type of machine that it runs on.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2706
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2707 The way to build a cross-compiler, cross-assembler, or what have you, is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2708 to specify the option @samp{--host=@var{hosttype}} when running
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2709 @code{configure}. This specifies the host system without changing the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2710 type of target system. The syntax for @var{hosttype} is the same as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2711 described above.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2712
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2713 Bootstrapping a cross-compiler requires compiling it on a machine other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2714 than the host it will run on. Compilation packages accept a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2715 configuration option @samp{--build=@var{hosttype}} for specifying the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2716 configuration on which you will compile them, in case that is different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2717 from the host.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2718
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2719 Programs for which cross-operation is not meaningful need not accept the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2720 @samp{--host} option, because configuring an entire operating system for
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2721 cross-operation is not a meaningful thing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2722
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2723 Some programs have ways of configuring themselves automatically. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2724 your program is set up to do this, your @code{configure} script can simply
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2725 ignore most of its arguments.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2726
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2727 @comment The makefile standards are in a separate file that is also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2728 @comment included by make.texinfo. Done by roland@gnu.ai.mit.edu on 1/6/93.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2729 @comment For this document, turn chapters into sections, etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2730 @lowersections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2731 @include make-stds.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2732 @raisesections
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2733
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2734 @node Releases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2735 @section Making Releases
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2736
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2737 Package the distribution of Foo version 69.96 in a gzipped tar file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2738 named @file{foo-69.96.tar.gz}. It should unpack into a subdirectory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2739 named @file{foo-69.96}.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2740
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2741 Building and installing the program should never modify any of the files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2742 contained in the distribution. This means that all the files that form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2743 part of the program in any way must be classified into @dfn{source
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2744 files} and @dfn{non-source files}. Source files are written by humans
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2745 and never changed automatically; non-source files are produced from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2746 source files by programs under the control of the Makefile.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2747
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2748 Naturally, all the source files must be in the distribution. It is okay
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2749 to include non-source files in the distribution, provided they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2750 up-to-date and machine-independent, so that building the distribution
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2751 normally will never modify them. We commonly include non-source files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2752 produced by Bison, @code{lex}, @TeX{}, and @code{makeinfo}; this helps avoid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2753 unnecessary dependencies between our distributions, so that users can
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2754 install whichever packages they want to install.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2755
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2756 Non-source files that might actually be modified by building and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2757 installing the program should @strong{never} be included in the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2758 distribution. So if you do distribute non-source files, always make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2759 sure they are up to date when you make a new distribution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2760
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2761 Make sure that the directory into which the distribution unpacks (as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2762 well as any subdirectories) are all world-writable (octal mode 777).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2763 This is so that old versions of @code{tar} which preserve the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2764 ownership and permissions of the files from the tar archive will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2765 able to extract all the files even if the user is unprivileged.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2766
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2767 Make sure that all the files in the distribution are world-readable.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2768
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2769 Make sure that no file name in the distribution is more than 14
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2770 characters long. Likewise, no file created by building the program
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2771 should have a name longer than 14 characters. The reason for this is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2772 that some systems adhere to a foolish interpretation of the POSIX
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2773 standard, and refuse to open a longer name, rather than truncating as
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2774 they did in the past.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2775
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2776 Don't include any symbolic links in the distribution itself. If the tar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2777 file contains symbolic links, then people cannot even unpack it on
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2778 systems that don't support symbolic links. Also, don't use multiple
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2779 names for one file in different directories, because certain file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2780 systems cannot handle this and that prevents unpacking the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2781 distribution.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2782
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2783 Try to make sure that all the file names will be unique on MS-DOS. A
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2784 name on MS-DOS consists of up to 8 characters, optionally followed by a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2785 period and up to three characters. MS-DOS will truncate extra
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2786 characters both before and after the period. Thus,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2787 @file{foobarhacker.c} and @file{foobarhacker.o} are not ambiguous; they
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2788 are truncated to @file{foobarha.c} and @file{foobarha.o}, which are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2789 distinct.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2790
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2791 Include in your distribution a copy of the @file{texinfo.tex} you used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2792 to test print any @file{*.texinfo} or @file{*.texi} files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2793
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2794 Likewise, if your program uses small GNU software packages like regex,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2795 getopt, obstack, or termcap, include them in the distribution file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2796 Leaving them out would make the distribution file a little smaller at
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2797 the expense of possible inconvenience to a user who doesn't know what
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2798 other files to get.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2799
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2800 @contents
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2801
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2802 @bye