aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authormvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 20:48:33 +0000
committermvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b>2008-06-19 20:48:33 +0000
commitc342cdeaf3a971c5df904b312539c7c3082c60f5 (patch)
tree7b42274bee0dd9b38bbd91570bf09a13d1c6aef0 /doc
parentf06c83d2c47969db738a3f45b729e6c9906bbbd5 (diff)
Older versions of GNU gcc do not allow 'NULL' as sentinel.
They want (char *)NULL as sentinel. An example is OpenBSD (confirmed on 4.3) that ships with gcc 3.3.4 This commit introduces a contstant SENTINEL which is declared as: #define SENTINEL ((char *)NULL) All places I could test compile on my openbsd system are converted. Update CODING-GUIDELINES to tell about this constant. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@124127 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'doc')
-rw-r--r--doc/CODING-GUIDELINES9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc/CODING-GUIDELINES b/doc/CODING-GUIDELINES
index aeca4a15b..53fd15da3 100644
--- a/doc/CODING-GUIDELINES
+++ b/doc/CODING-GUIDELINES
@@ -296,6 +296,15 @@ in other files. You will have to remove the "static" declaration and define a
prototype in an appropriate header file (usually in include/asterisk). A more
specific name should be given, such as "ast_find_call_feature".
+* Variable function argument parsing
+------------------------------------
+
+Functions with a variable amount of argumenst need a 'sentinel' when called.
+Newer GNU C compilers are fine if you use NULL for this. Older versions (pre 4)
+don't like this.
+You should use the constant SENTINEL.
+This one is defined in include/asterisk/compiler.h
+
* Variable naming
-----------------