From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/2] STYLE: document some rules about variable declarations
Date: Sat, 13 Feb 2016 13:11:18 -0400 [thread overview]
Message-ID: <1455383479-9946-1-git-send-email-david@tethera.net> (raw)
No-one seemed opposed to C99 style loop variable declarations. The
requirement to declare variables at the top of blocks is maybe a little
more contested, but I believe it reflects the status quo.
---
devel/STYLE | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/devel/STYLE b/devel/STYLE
index 24bd548..b22d8d3 100644
--- a/devel/STYLE
+++ b/devel/STYLE
@@ -25,9 +25,7 @@ The following nonsense code demonstrates many aspects of the style:
static some_type
function (param_type param, param_type param)
{
- int i;
-
- for (i = 0; i < 10; i++) {
+ for (int i = 0; i < 10; i++) {
int j;
j = i + 10;
@@ -64,6 +62,9 @@ function (param_type param, param_type param)
* Code lines should be less than 80 columns and comments should be
wrapped at 70 columns.
+* Variable declarations should be at the top of a block; C99 style
+ control variable declarations in for loops are also OK.
+
Naming
------
--
2.6.4
next reply other threads:[~2016-02-13 17:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-13 17:11 David Bremner [this message]
2016-02-13 17:11 ` [PATCH 2/2] STYLE: suggest long names David Bremner
2016-03-05 0:49 ` [PATCH 1/2] STYLE: document some rules about variable declarations David Bremner
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455383479-9946-1-git-send-email-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).