I'll push this if I don't hear anything.

The code adheres to these rules at this point pretty much.
There are a few sites that could be a bit better, but I don't
fear that there are plentiful of bad examples that are
copied and pasted.

-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
From fabad46f798579c9a18e82c5fa253e8ae77d0550 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?=C3=98yvind=20Harboe?= <oyvind.har...@zylin.com>
Date: Tue, 24 Nov 2009 20:26:40 +0100
Subject: [PATCH] styleguide: add some embedded style rules.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Embedded and pthreads rely on modest and predictable
stack usage.

Signed-off-by: Øyvind Harboe <oyvind.har...@zylin.com>
---
 doc/manual/style.txt |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/doc/manual/style.txt b/doc/manual/style.txt
index b4d0216..0ba86c2 100644
--- a/doc/manual/style.txt
+++ b/doc/manual/style.txt
@@ -40,6 +40,12 @@ OpenOCD's Jim/TCL code as well.
 This page contains guidelines for writing new C source code for the
 OpenOCD project.
 
+...@section styleembedded Embedded hosts
+
+- allocate working space dynamically(malloc) rather than
+using lots of stack. non-MMU(embedded) hosts and pthreads
+rely on modest and predictable stack usage.
+
 @section styleformat Formatting Guide
 
 - remove any trailing white space at the end of lines.
@@ -80,6 +86,8 @@ Finally, try to avoid lines of code that are longer than than 72-80 columns:
 - designated initializers (@{ .field = value @})
 - variables declarations should occur at the point of first use
 - new block scopes for selection and iteration statements
+- do not use dynamic arrays. Dynamic arrays are problematic with
+embedded/non-MMU targets, and also somewhat with pthreads.
 
 @section styletypes Type Guidelines
 - use native types (@c int or @c unsigned) if the type is not important
-- 
1.6.3.3

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to