From: Pekka Pessi <[email protected]>

---
 doc/coding-style.txt |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/doc/coding-style.txt b/doc/coding-style.txt
index 9dfdc09..9d7131d 100644
--- a/doc/coding-style.txt
+++ b/doc/coding-style.txt
@@ -230,6 +230,20 @@ array = g_try_new0(int, 20);
 if (array == NULL)     // Correct
        return;
 
+
+M14: Always use parenthesis with sizeof
+=======================================
+The expression argument to the sizeof operator should always be in
+parenthesis, too.
+
+Example:
+1)
+memset(stuff, 0, sizeof(*stuff));
+
+2)
+memset(stuff, 0, sizeof *stuff); // Wrong
+
+
 O1: Shorten the name
 ====================
 Better to use abbreviation, rather than full name, to name a variable,
-- 
1.7.1

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to