Hi ams, "Alfred M. Szmidt" <[email protected]> writes:
> The patch just removes the section with examples, those examples are
> useful to understand how to write code for actual chapter on
> pre-standard code, and it is not much text as such. The overal text
> is exactly the same, so how does that solve the issues raised?
>
> Overall this makes the chapter worse, I don't see how this makes
> anything better.
>
> Can we please keep off exgagerating things, "wastes reader time",
> "harms users" are not helpful arguments.
Okay, how about this (more serious) suggestion:
--8<---------------cut here---------------start------------->8---
diff --git a/doc/standards.texi b/doc/standards.texi
index 30592c65..da17d736 100644
--- a/doc/standards.texi
+++ b/doc/standards.texi
@@ -3,7 +3,7 @@
@setfilename standards.info
@settitle GNU Coding Standards
@c This date is automagically updated when you save this file:
-@set lastupdate August 17, 2021
+@set lastupdate October 13, 2024
@c %**end of header
@dircategory GNU organization
@@ -407,10 +407,13 @@ @node Standard C
use these features if GCC supports them, when they give substantial
benefit.
-However, it is easy to support pre-standard compilers in most programs,
-so if you know how to do that, feel free.
-
@cindex function prototypes
+Previously, this document recommended using pre-standard style of
+function definition, however, C23 has entirely removed unprototyped
+definitions, and compilers that do not support the standard style of
+function definition are few and far between. Due to this, it is no
+longer worth the trouble to support such pre-standard compilers.
+
To support pre-standard C, instead of writing function definitions in
standard prototype form,
@@ -421,7 +424,7 @@ @node Standard C
@end example
@noindent
-write the definition in pre-standard style like this,
+definitions were written in pre-standard style like this,
@example
int
@@ -431,16 +434,14 @@ @node Standard C
@end example
@noindent
-and use a separate declaration to specify the argument prototype:
+and used a separate declaration to specify the argument prototype:
@example
int foo (int, int);
@end example
You need such a declaration anyway, in a header file, to get the benefit
-of prototypes in all the files where the function is called. And once
-you have the declaration, you normally lose nothing by writing the
-function definition in the pre-standard style.
+of prototypes in all the files where the function is called..
This technique does not work for integer types narrower than @code{int}.
If you think of an argument as being of a type narrower than @code{int},
--8<---------------cut here---------------end--------------->8---
I've edited the "To support pre-standard C..." sentence to be in a past
tense to indicate that this /used to/ be practice (and to preserve the
knowledge of how it happened), and removed "normally lose nothing"
because it is no longer true (C23 entirely removes the construct, so
programs using it will have trouble with strict C23 compliance
eventually), as well as adding a clarification paragraph.
It is likely that GCC will keep supporting this style of function
definition, but given that C won't, and that it is more likely that one
would use a standard than pre-standard CC nowadays, I think I'm
justified in saying "no longer worth the trouble".
I'm not sure if I respected the linguistic conventions of this document
correctly, but from a quick scan it seems OK.
WDYT?
--
Arsen Arsenović
signature.asc
Description: PGP signature
