This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: codingconventions.html update for new intl directory
- From: "Zack Weinberg" <zack at codesourcery dot com>
- To: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 08 Oct 2003 08:37:44 -0700
- Subject: Re: codingconventions.html update for new intl directory
- References: <871xx6rtp2.fsf@egil.codesourcery.com><Pine.LNX.4.56.0307042049030.27883@kern.srcf.societies.cam.ac.uk>
"Joseph S. Myers" <jsm28@cam.ac.uk> writes:
> On Fri, 4 Jul 2003, Zack Weinberg wrote:
>
>> +<p>GCC is written in ISO C90. Use of features of ISO C99, or GNU
>
> Some non-C front ends use GNU extensions present in 2.95 (though this is
> to be discouraged for the C++ front end). libiberty still uses K&R.
> Some of README.Portability is still relevant for ISO C files, and the rest
> as an illustration of the sort of thing to look out for when converting to
> ISO C.
>
> (I don't recommend mentioning the specific 2.95 version number in
> codingconventions.html; it should just link to install/prerequisites.html
> for that sort of version compatibility requirement. But that requirement
> is significant; non-C front ends can't yet use C99 features that were
> added in GCC 3.0.)
I was just reminded that this never got resolved, although I did edit
the commentary a bit to be clearer. What do you think of this
version?
I'm not inclined to sanction the use of GNU extensions *at all* in
GCC; I think the entire compiler should be buildable with a C90-only C
compiler. (Conditional use of extensions, with proper fallbacks, is OK.)
zw
===================================================================
Index: htdocs/codingconventions.html
--- htdocs/codingconventions.html 30 Jul 2003 16:52:09 -0000 1.29
+++ htdocs/codingconventions.html 8 Oct 2003 15:35:52 -0000
@@ -72,15 +72,26 @@ of the ChangeLog entry.</p>
<h2>Portability</h2>
-<p>There are strict requirements for portability of code in GCC to
-older systems whose compilers do not implement the ISO C standard.
-See <a
-href="http://gcc.gnu.org/cgi-bin/cvsweb.cgi/~checkout~/gcc/gcc/README.Portability?content-type=text/plain&only_with_tag=HEAD">README.Portability</a>
-for details of some of the portability problems that may arise. Some
-of these problems are warned about by <code>gcc -Wtraditional</code>,
-which is included in the default warning options in a bootstrap.
-(Code outside the C front end is only compiled by GCC, so such
-requirements do not apply to it.)</p>
+<p>Most of GCC is written in ISO C90. Use of features of ISO C99, or
+GNU extensions, must be properly guarded with preprocessor
+conditionals so that it still compiles and works with other
+compilers.</p>
+
+<p>Some of GCC's source files are still written with the expectation
+that they must be usable with "K+R" (pre-standard) compilers. Patches
+to convert such files to ISO C are welcome. However, please keep the
+style of any given file consistent; do not introduce new-style
+function definitions in a file that currently uses old-style, unless
+you are converting the entire file. (Functions that take a variable
+number of arguments are an exception. They should be written in ISO C
+style even if the rest of the file is still in K+R style.)</p>
+
+<p>Some of GCC's source files make use of GNU extensions without
+proper fallbacks for other compilers. This is strongly discouraged;
+however, as long as the code is neither part of the
+language-independent compiler, nor part of the C front end, it is
+tolerated. Patches to remove unconditional uses of extensions are also
+welcome.</p>
<p>The programs included in GCC are linked with the
libiberty library, which will replace some standard
@@ -104,6 +115,9 @@ system. Exceptions may be made to this
the release cycle, to reduce the risk involved in fixing a problem
that only shows up on one particular system.</p>
+<p>See the file <a href=
+"http://gcc.gnu.org/cgi-bin/cvsweb.cgi/~checkout~/gcc/gcc/README.Portability?content-type=text/plain&only_with_tag=HEAD"><code>gcc/README.Portability</code></a>
+in the tree for further details.
<h2>Makefiles</h2>
@@ -408,6 +422,25 @@ When you check in a patch to one of thes
the src tree too, or ask someone else with CVS write access there to
do so.</li>
+<li>Top-level files ABOUT-NLS and config.rpath: These files are taken
+from <a href="http://www.gnu.org/software/gettext/">GNU gettext</a>,
+which can be downloaded from <a href=
+"ftp://ftp.gnu.org/pub/gnu/gettext/">ftp://ftp.gnu.org/pub/gnu/gettext/</a>.
+Proposed changes should be e-mailed to <a
+href="mailto:bug-gnu-gettext@gnu.org">bug-gnu-gettext@gnu.org</a>.
+Only after the change appears in a released gettext distribution
+should it be installed in the GCC CVS tree.</li>
+
+<li>intl: Most, but not all, of the content of this directory is also
+taken unmodified from GNU gettext. Proposed changes to the unmodified
+files should be sent to the gettext maintainers first. Proposed
+changes to the files that have been modified, or created from scratch,
+should be submitted to gcc-patches normally. See the file <a href=
+"http://gcc.gnu.org/cgi-bin/cvsweb.cgi/~checkout~/gcc/intl/README?content-type=text/plain&only_with_tag=HEAD"><code>intl/README</code></a>
+in the tree for details. Note that new upstream releases of GNU
+gettext cannot be incorporated unmodified; consult the mailing list
+for assistance.</li>
+
<li>Top-level depcomp, install-sh, missing, and mkinstalldirs: These are
copied from automake, using
<code>automake-1.7 --add-missing --copy --force-missing</code>.</li>
@@ -434,6 +467,5 @@ FSF website, or are autogenerated. Thes
without prior permission, if at all.</li>
</ul>
-
</body>
</html>