This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: codingconventions.html update for new intl directory

"Joseph S. Myers" <> 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

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.)


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>
-<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
-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
+<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
 <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=
+in the tree for further details.
@@ -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="";>GNU gettext</a>,
+which can be downloaded from <a href=
+Proposed changes should be e-mailed to <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=
+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>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]