From: Volker Lendecke Date: Wed, 30 May 2012 08:14:51 +0000 (+0200) Subject: Coding: Add comment disproving control-flow changing macros X-Git-Tag: ldb-1.1.14~487 X-Git-Url: http://git.samba.org/samba.git/?p=vlendec%2Fsamba-autobuild%2F.git;a=commitdiff_plain;h=be300b0588729c3c87f765e2737ebaccc0af02ff Coding: Add comment disproving control-flow changing macros --- diff --git a/README.Coding b/README.Coding index 84162908610..956a733a4ce 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.