From: Øyvind Harboe Date: Tue, 24 Nov 2009 19:26:40 +0000 (+0100) Subject: styleguide: add some embedded style rules. X-Git-Tag: v0.4.0-rc1~317 X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=commitdiff_plain;h=060980357df2f71b8d18eb6a86a8c9878a8b417e;hp=3f8aa3cb035a97988fd38dfb08db5a4224f4b591 styleguide: add some embedded style rules. Embedded and pthreads rely on modest and predictable stack usage. Signed-off-by: Øyvind Harboe --- diff --git a/doc/manual/style.txt b/doc/manual/style.txt index b4d0216586..71bb5f6bc1 100644 --- a/doc/manual/style.txt +++ b/doc/manual/style.txt @@ -80,6 +80,9 @@ 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 +- use malloc() to create dynamic arrays. Do @b not use @c alloca +or variable length arrays on the stack. non-MMU hosts(uClinux) and +pthreads require modest and predictable stack usage. @section styletypes Type Guidelines - use native types (@c int or @c unsigned) if the type is not important