summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-05-30 10:14:51 +0200
committerVolker Lendecke <vl@samba.org>2012-09-26 16:29:28 +0200
commitbe300b0588729c3c87f765e2737ebaccc0af02ff (patch)
tree8e477ad04412d08a98fe25d5b68e866e8134383a
parent1fa730deba0f36947775fe490b9be98a92560b3f (diff)
downloadsamba-be300b0588729c3c87f765e2737ebaccc0af02ff.tar.gz
samba-be300b0588729c3c87f765e2737ebaccc0af02ff.tar.bz2
samba-be300b0588729c3c87f765e2737ebaccc0af02ff.zip
Coding: Add comment disproving control-flow changing macros
-rw-r--r--README.Coding10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.Coding b/README.Coding
index 8416290861..956a733a4c 100644
--- a/README.Coding
+++ b/README.Coding
@@ -367,3 +367,13 @@ Bad Example:
ret = some_function_my_name(get_some_name());
...
+Control-Flow changing macros
+----------------------------
+
+Macros like NT_STATUS_NOT_OK_RETURN that change control flow
+(return/goto/etc) from within the macro are considered bad, because
+they look like function calls that never change control flow. Please
+do not use them in new code.
+
+The only exception is the test code that depends repeated use of calls
+like CHECK_STATUS, CHECK_VAL and others.