* socket.c (scm_fill_sockaddr): zero the address structure before
[bpt/guile.git] / HACKING
CommitLineData
23bcd7ad 1Here are some guidelines for members of the Guile developers team.
795b4217 2
0822a9c1
JB
3Contributing Your Changes ============================================
4
5- If you have put together a change that meets the coding standards
6described below, we encourage you to submit it to Guile. The best
c5ee0952
JB
7place to post it is guile@sourceware.cygnus.com. Please don't send it
8directly to me; I often don't have time to look things over. If you
9have tested your change, then you don't need to be shy.
0822a9c1
JB
10
11- Please submit patches using either context or unified diffs (diff -c
12or diff -u). Don't include a patch for ChangeLog; such patches don't
13apply cleanly, since we've probably changed the top of ChangeLog too.
14Instead, provide the unaltered text at the top of your patch.
15
16Please don't include patches for generated files like configure,
17aclocal.m4, or any Makefile.in. Such patches are often large, and
18we're just going to regenerate those files anyway.
19
20
d2bd3d8d
JB
21CVS conventions ======================================================
22
eb4194d6 23- We use CVS to manage the Guile sources. The repository lives on
349d9c1f 24egcs.cygnus.com, in /cvs/guile; you will need an
aa31443a
JB
25account on that machine to access the repository. Also, for security
26reasons, egcs presently only supports CVS connections via the SSH
27protocol, so you must first install the SSH client. Then, you should
28set your CVS_RSH environment variable to ssh, and use the following as
29your CVS root:
eb4194d6 30
349d9c1f 31 :ext:USER@egcs.cygnus.com:/cvs/guile
eb4194d6
JB
32
33Either set your CVSROOT environment variable to that, or give it as
34the value of the global -d option to CVS when you check out a working
35directory.
36
848f2a01 37For more information on SSH, see http://www.cs.hut.fi/ssh.
eb4194d6
JB
38
39The Guile sources live in several modules:
40
41 - guile-core --- the interpreter, QuickThreads, and ice-9
e19268af
JB
42 - guile-doc --- documentation in progress. When complete, this will
43 be incorporated into guile-core.
15fb0024 44 - guile-oops --- The Guile Object-Oriented Programming System (talk to mdj)
eb4194d6 45 - guile-tcltk --- the Guile/Tk interface
b1f4ddc1 46 - guile-tk --- the new Guile/Tk interface, based on STk's modified Tk
eb4194d6
JB
47 - guile-rgx-ctax --- the Guile/Rx interface, and the ctax implementation
48 - guile-scsh --- the port of SCSH to guile, talk to Gary Houston
b1f4ddc1 49 - guile-www --- A Guile module for making HTTP requests.
eb4194d6 50
afdfe3f4
JB
51There is a mailing list for CVS commit messages; see README for details.
52
d2bd3d8d
JB
53- We check Makefile.in and configure files into CVS, as well as the
54files they are built from (Makefile.am, configure.in); we do not check
55in Makefiles or header files generated by configuration scripts. The
350294b1 56general rule is that you should be able to check out a working
d2bd3d8d
JB
57directory of Guile from CVS, and then type "configure" and "make",
58without running any other tools.
350294b1 59
d4c83f63
JB
60- (Automake 1.4 only) Be sure to run automake at the top of the tree
61with no arguments. Do not use `automake Makefile' to regenerate
62specific Makefile.in files, and do not trust the Makefile rules to
63rebuild them when they are out of date. Automake 1.4 will add
64extraneous rules to the top-level Makefile if you specify specific
65Makefiles to rebuild on the command line. Running the command
66`autoreconf --force' should take care of everything correctly.
67
795b4217
JB
68- Make sure your changes compile and work, at least on your own
69machine, before checking them into the main branch of the Guile
70repository. If you really need to check in untested changes, make a
71branch.
72
d2bd3d8d
JB
73- Include each log entry in both the ChangeLog and in the CVS logs.
74If you're using Emacs, the pcl-cvs interface to CVS has features to
75make this easier; it checks the ChangeLog, and generates good default
76CVS log entries from that.
77
78
79Coding standards =====================================================
80
81- As for any part of Project GNU, changes to Guile should follow the
82GNU coding standards. The standards are available via anonymous FTP
83from prep.ai.mit.edu, as /pub/gnu/standards/standards.texi and
84make-stds.texi.
85
99be3450
JB
86- The Guile tree should compile without warnings under the following
87GCC switches, which are the default in the current configure script:
859bb431 88 -O2 -Wall -Wpointer-arith -Wmissing-prototypes
18fa97f8
JB
89The only warnings which can be tolerated are those about variables
90being clobbered by longjmp/vfork in eval.c. The variables in question
91are critical to the interpreter's performance; as far as I can tell,
92it is difficult/annoying to avoid these warnings without slowing the
93system down substantially. (If you can figure out a good fix, I'd be happy to see it.)
99be3450 94
d043e0bb
JB
95Note that the warnings generated vary from one version of GCC to the
96next, and from one architecture to the next (apparently). To provide
97a concrete common standard, Guile should compile without warnings from
18fa97f8 98GCC 2.7.2.3 in a Red Hat 5.2 i386 Linux machine. Furthermore, each
d043e0bb
JB
99developer should pursue any additional warnings noted by on their
100compiler. This means that people using more stringent compilers will
101have more work to do, and assures that everyone won't switch to the
41d368d9 102most lenient compiler they can find. :)
d043e0bb 103
afdfe3f4
JB
104Note also that EGCS (as of November 3 1998) doesn't handle the
105`noreturn' attribute properly, so it doesn't understand that functions
106like scm_error won't return. This may lead to some silly warnings
107about uninitialized variables. You should look into these warnings to
108make sure they are indeed spurious, but you needn't correct warnings
109caused by this EGCS bug.
110
0822a9c1
JB
111- If you add code which uses functions or other features that are not
112entirely portable, please make sure the rest of Guile will still
113function properly on systems where they are missing. This usually
114entails adding a test to configure.in, and then adding #ifdefs to your
115code to disable it if the system's features are missing.
afdfe3f4 116
795b4217
JB
117- When you make a user-visible change (i.e. one that should be
118documented, and appear in NEWS, put an asterisk in column zero of the
119start of the ChangeLog entry, like so:
120
121Sat Aug 3 01:27:14 1996 Gary Houston <ghouston@actrix.gen.nz>
122
123* * fports.c (scm_open_file): don't return #f, throw error.
124
fa3f45cc
JB
125When you've written a NEWS entry and updated the documentation, go
126ahead and remove the asterisk. I will use the asterisks to find and
127document changes that haven't been dealt with before a release.
128
d49a7907
JB
129- Please write log entries for functions written in C under the
130functions' C names, and write log entries for functions written in
131Scheme under the functions' Scheme names. Please don't do this:
132
133 * procs.c, procs.h (procedure-documentation): Moved from eval.c.
134
135Entries like this make it harder to search the ChangeLogs, because you
afdfe3f4
JB
136can never tell which name the entry will refer to. Instead, write this:
137
138 * procs.c, procs.h (scm_procedure_documentation): Moved from eval.c.
d49a7907 139
4085a3da
JB
140Changes like adding this line are special:
141
142 SCM_PROC (s_serial_map, "serial-map", 2, 0, 1, scm_map);
143
144Since the change here is about the name itself --- we're adding a new
145alias for scm_map that guarantees the order in which we process list
146elements, but we're not changing scm_map at all --- it's appropriate
147to use the Scheme name in the log entry.
148
30d14d55
JB
149- There's no need to keep a change log for documentation files. This
150is because documentation is not susceptible to bugs that are hard to
151fix. Documentation does not consist of parts that must interact in a
152precisely engineered fashion; to correct an error, you need not know
153the history of the erroneous passage. (This is copied from the GNU
154coding standards.)
155
795b4217
JB
156- Make sure you have papers from people before integrating their
157changes or contributions. This is very frustrating, but very
158important to do right. From maintain.texi, "Information for
159Maintainers of GNU Software":
160
161 When incorporating changes from other people, make sure to follow the
162 correct procedures. Doing this ensures that the FSF has the legal
163 right to distribute and defend GNU software.
164
165 For the sake of registering the copyright on later versions ofthe
166 software you need to keep track of each person who makes significant
167 changes. A change of ten lines or so, or a few such changes, in a
168 large program is not significant.
169
170 *Before* incorporating significant changes, make sure that the person
171 has signed copyright papers, and that the Free Software Foundation has
172 received them.
173
174If you receive contributions you want to use from someone, let me know
175and I'll take care of the administrivia. Put the contributions aside
176until we have the necessary papers.
177
fa3f45cc
JB
178- When you make substantial changes to a file, add the current year to
179the list of years in the copyright notice at the top of the file.
795b4217 180
d2bd3d8d
JB
181
182Helpful hints ========================================================
183
f84f77f5
JB
184- [From Mikael Djurfeldt] When working on the Guile internals, it is
185quite often practical to implement a scheme-level procedure which
186helps you examine the feature you're working on.
187
188Examples of such procedures are: pt-size, debug-hand and
189current-pstate.
190
191I've now put #ifdef GUILE_DEBUG around all such procedures, so that
192they are not compiled into the "normal" Guile library. Please do the
193same when you add new procedures/C functions for debugging purpose.
194
195You can define the GUILE_DEBUG flag by passing --enable-guile-debug to
196the configure script.
197
52591c80
JB
198- You'll see uses of the macro SCM_P scattered throughout the code;
199those are vestiges of a time when Guile was meant to compile on
200pre-ANSI compilers. Guile now requires ANSI C, so when you write new
201functions, feel free to use ANSI declarations, and please provide
1cf84ea5 202prototypes for everything. You don't need to use SCM_P in new code.
52591c80 203
795b4217
JB
204
205Jim Blandy