mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 03:20:57 +00:00
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: https://origsvn.digium.com/svn/asterisk/trunk@124127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -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
|
||||
-----------------
|
||||
|
||||
|
Reference in New Issue
Block a user