summaryrefslogtreecommitdiffstats
path: root/README.Coding
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-11-01 12:04:38 +0000
committerMichael Adam <obnox@samba.org>2013-11-11 16:08:09 +0100
commit0eaae1a87fee60675d8d9f48f8a5f5cb583f0e14 (patch)
treea8adc92a360c73daa1c0e416bf39afdca6f02423 /README.Coding
parentbbb5f66bcd4f096f7b1281e4fda6fdb488f064bc (diff)
downloadsamba-0eaae1a87fee60675d8d9f48f8a5f5cb583f0e14.tar.gz
samba-0eaae1a87fee60675d8d9f48f8a5f5cb583f0e14.tar.xz
samba-0eaae1a87fee60675d8d9f48f8a5f5cb583f0e14.zip
README.Coding: Add __func__
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
Diffstat (limited to 'README.Coding')
-rw-r--r--README.Coding14
1 files changed, 14 insertions, 0 deletions
diff --git a/README.Coding b/README.Coding
index 956a733a4c..107856e45f 100644
--- a/README.Coding
+++ b/README.Coding
@@ -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__));