bug-standards
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

standards.texi, C11, POSIX.1-2008, and K&R


From: Paul Eggert
Subject: standards.texi, C11, POSIX.1-2008, and K&R
Date: Sat, 29 Dec 2012 13:51:14 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

The GNU coding standards need updating in some respects:

* They don't mention C11 (discussion is limited to C89 and C99).

* They should mention POSIX.1-2008 in preference to POSIX.1-2001.

* They advise maintainers to continue to support for pre-C89
  if the programs already do that, but this advice has not matched
  existing practice for some time.  For example, in GNU Emacs (a
  conservatively-run package), support for pre-C89 compilers was
  removed in 2010, as the maintenance hassle outweighed its benefits.

As I understand it RMS was asked a while ago about the 3rd point and
responded with something like "ask me again in five years".  In
practice, it's well past time to do this update, so I thought I'd
raise the issue again.

Here's a proposed patch.

diff --git a/doc/standards.texi b/doc/standards.texi
index 5fb433f..3f246ad 100644
--- a/doc/standards.texi
+++ b/doc/standards.texi
@@ -411,15 +411,15 @@ already.  That would be extremely troublesome in certain 
cases.
 @cindex @sc{ansi} C standard
 
 1989 Standard C is widespread enough now that it is ok to use its
-features in new programs.  There is one exception: do not ever use the
+features in programs.  There is one exception: do not ever use the
 ``trigraph'' feature of Standard C.
 
-1999 Standard C is not widespread yet, so please do not require its
-features in programs.  It is ok to use its features if they are present.
+The 1999 and 2011 editions of Standard C are not fully supported on
+all platforms, so please do not require their features in programs.
+It is ok to use their features if they are present.
 
 However, it is easy to support pre-standard compilers in most programs,
-so if you know how to do that, feel free.  If a program you are
-maintaining has such support, you should try to keep it working.
+so if you know how to do that, feel free.
 
 @cindex function prototypes
 To support pre-standard C, instead of writing function definitions in
@@ -2991,12 +2991,12 @@ from zero.
 
 Historically, C implementations differed substantially, and many
 systems lacked a full implementation of ANSI/ISO C89.  Nowadays,
-however, very few systems lack a C89 compiler and GNU C supports
-almost all of C99.  Similarly, most systems implement POSIX.1-1993
-libraries and tools, and many have POSIX.1-2001.
+however, all practical systems have a C89 compiler and GNU C supports
+almost all of C99 and some of C11.  Similarly, most systems implement
+POSIX.1-2001 libraries and tools, and many have POSIX.1-2008.
 
 Hence, there is little reason to support old C or non-POSIX systems,
-and you may want to take advantage of C99 and POSIX-1.2001 to write
+and you may want to take advantage of standard C and POSIX to write
 clearer, more portable, or faster code.  You should use standard
 interfaces where possible; but if GNU extensions make your program
 more maintainable, powerful, or otherwise better, don't hesitate to



reply via email to

[Prev in Thread] Current Thread [Next in Thread]