From: Steven Cole <elenstev@mesatop.com>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Russell King <rmk@arm.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] 2.5 Documentation/CodingStyle ANSI C function declarations.
Date: 30 May 2003 18:55:18 -0600 [thread overview]
Message-ID: <1054342517.2901.78.camel@spc> (raw)
In-Reply-To: <Pine.LNX.4.44.0305301414210.2671-100000@home.transmeta.com>
On Fri, 2003-05-30 at 15:17, Linus Torvalds wrote:
> On Fri, 30 May 2003, Russell King wrote:
> >
> > On Fri, May 30, 2003 at 01:57:13PM -0600, Steven Cole wrote:
> > > +int foo(
> > > + long bar,
> > > + long day,
> > > + struct magic *xyzzy
> > > +)
> >
> > Is this really part of the kernel coding style?
>
> No, but it's better than what it used to be.
>
> Also, while I don't think we should try to maintain 1:1 behaviour with
> the _worst_ offenses of zlib, I do think we should maintain comments etc,
> and a lot of the zlib function declarations used to look like
>
> int foo(bar, baz)
> long bar; /* number of frobnicators */
> long baz; /* self-larting on or off */
> {
> ....
>
> and the ANSI-fication changes this to
>
> int foo(
> long bar, /* number of frobnicators */
> long baz /* self-larting on or off */
> )
> {
> ...
>
> which while not according to the coding-standard is at least a reasonable
> compromize between having proper C function definitions and keeping the
> code _looking_ more like the original.
>
> Linus
>
>
OK, here is a modified version of the patch to CodingStyle which
explicitly notes the reason for this secondary style.
Steven
--- linux/Documentation/CodingStyle.orig 2003-05-30 18:41:05.000000000 -0600
+++ linux/Documentation/CodingStyle 2003-05-30 18:46:08.000000000 -0600
@@ -149,6 +149,23 @@
and it gets confused. You know you're brilliant, but maybe you'd like
to understand what you did 2 weeks from now.
+Function declarations should be new-style:
+
+int foo(long bar, long baz, struct magic *xyzzy)
+
+or when replacing old-style declarations which have comments:
+
+int foo(
+ long bar,
+ long baz,
+ struct magic *xyzzy /* essential comment */
+)
+
+Old-style function declarations are deprecated:
+
+int foo(bar, baz, xyzzy)
+long bar, baz;
+struct magic *xyzzy; /* essential comment */
Chapter 5: Commenting
next prev parent reply other threads:[~2003-05-31 0:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-30 19:57 [PATCH] 2.5 Documentation/CodingStyle ANSI C function declarations Steven Cole
2003-05-30 20:14 ` Jörn Engel
2003-05-30 20:25 ` Steven Cole
2003-05-30 20:40 ` Jörn Engel
2003-05-30 20:48 ` Linus Torvalds
2003-05-30 21:20 ` Jörn Engel
2003-05-30 21:38 ` Linus Torvalds
2003-05-30 22:26 ` Jörn Engel
2003-05-30 22:39 ` Davide Libenzi
2003-05-30 22:23 ` Alan Cox
2003-05-30 23:29 ` Davide Libenzi
2003-05-30 22:49 ` Linus Torvalds
2003-05-30 22:55 ` viro
2003-05-30 22:58 ` Jörn Engel
2003-05-30 23:08 ` Riley Williams
2003-05-30 21:06 ` Jörn Engel
2003-05-30 21:09 ` Russell King
2003-05-30 21:17 ` Linus Torvalds
2003-05-31 0:55 ` Steven Cole [this message]
2003-05-31 3:12 ` Arnaldo Carvalho de Melo
2003-05-31 5:08 ` Steven Cole
2003-05-31 5:24 ` Michael Frank
2003-05-31 6:27 ` Bernd Eckenfels
2003-05-31 7:17 ` Bernd Eckenfels
2003-06-02 10:53 ` Juan Quintela
2003-06-02 15:59 ` Linus Torvalds
2003-06-02 16:39 ` Steven Cole
2003-06-02 17:34 ` Arnaldo Carvalho de Melo
2003-06-02 17:55 ` Steven Cole
2003-06-02 17:56 ` Jörn Engel
2003-06-02 16:40 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1054342517.2901.78.camel@spc \
--to=elenstev@mesatop.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.