README.Coding: Add __func__
authorVolker Lendecke <vl@samba.org>
Fri, 1 Nov 2013 12:04:38 +0000 (12:04 +0000)
committerMichael Adam <obnox@samba.org>
Mon, 11 Nov 2013 15:08:09 +0000 (16:08 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Nov 11 16:08:09 CET 2013 on sn-devel-104

README.Coding

index 956a733a4ce77e7d4b7dd4ceec0dd6449bc3a323..107856e45f17c78cdec8acada0ea0e66282cfec9 100644 (file)
@@ -377,3 +377,17 @@ 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.
+
+
+Function names in DEBUG statements
+----------------------------------
+
+Many DEBUG statements contain the name of the function they appear in. This is
+not a good idea, as this is prone to bitrot. Function names change, code
+moves, but the DEBUG statements are not adapted. Use %s and __func__ for this:
+
+Bad Example:
+       DEBUG(0, ("strstr_m: src malloc fail\n"));
+
+Good Example:
+       DEBUG(0, ("%s: src malloc fail\n", __func__));