git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <junkio@cox.net>
Cc: Martin Waitz <tali@admingilde.org>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	git@vger.kernel.org
Subject: [PATCH] SubmittingPatches: mention older C compiler compatibility
Date: Mon, 21 May 2007 13:48:49 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0705211347540.6410@racer.site> (raw)
In-Reply-To: <7vabvyfw7n.fsf@assigned-by-dhcp.cox.net>


We do not appreciate C99 initializers, declarations after statements,
or "0" instead of "NULL".

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	On Mon, 21 May 2007, Junio C Hamano wrote:
	
	> Portability rules:
	> 
	>  - We do not do C99 initializers;
	>  - We do not do decl-after-statement;
	> 
	> Readability rules:
	> 
	>  - We always write NULL, not 0, for a NULL pointer.
	> 
	> There may be a handful more unwritten rules we use.

	... so let's start with these 3.

 Documentation/SubmittingPatches |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index 6a4da2d..cc74b4b 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -65,6 +65,19 @@ in templates/hooks--pre-commit.  To help ensure this does not happen,
 run git diff --check on your changes before you commit.
 
 
+(1a) Try to be nice to older C compilers
+
+We pride ourselves with the wide range of C compilers you can compile
+git with. That means that you should not use C99 initializers, even
+if a lot of compilers grok it.
+
+Also, variables have to be declared at the beginning of the block
+(you can check this with gcc, using the -Wdeclaration-after-statement
+option).
+
+Another thing: NULL pointers shall be written as NULL, not as 0.
+
+
 (2) Generate your patch using git tools out of your commits.
 
 git based diff tools (git, Cogito, and StGIT included) generate

  reply	other threads:[~2007-05-21 12:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-20 15:42 [PATCH v2] Submodule merge support Martin Waitz
2007-05-21  6:20 ` Shawn O. Pearce
2007-05-21  7:32   ` Martin Waitz
2007-05-21  7:37     ` Shawn O. Pearce
2007-05-21  7:55       ` Junio C Hamano
2007-05-21 15:42       ` Alex Riesen
2007-05-21  7:54     ` Junio C Hamano
2007-05-21 12:48       ` Johannes Schindelin [this message]
2007-05-27 14:39         ` [PATCH] Add -Wdeclaration-after-statement to CFLAGS to help enforce the instructions in SubmittingPatches Johan Herland
2007-05-27 14:58           ` Morten Welinder

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=Pine.LNX.4.64.0705211347540.6410@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=spearce@spearce.org \
    --cc=tali@admingilde.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.
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 NNTP newsgroup(s).