Coding: Add comment disproving control-flow changing macros
[sfrench/samba-autobuild/.git] / README.Coding
index 8416290861026cd262916f2e8df2872644999516..956a733a4ce77e7d4b7dd4ceec0dd6449bc3a323 100644 (file)
@@ -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.