[asterisk-dev] murf: trunk r84330 - /trunk/utils/check_expr.c

Steve Murphy murf at parsetree.com
Tue Nov 20 20:52:01 CST 2007


On Tue, 2007-10-02 at 08:48 -0500, Tilghman Lesher wrote:
> On Tuesday 02 October 2007 03:02:31 Tony Mountifield wrote:
> > SVN commits to the Digium repositories <svn-commits at lists.digium.com> wrote:
> > > +void ast_mark_lock_acquired(void);
> > >  void ast_mark_lock_acquired(void)
> > >  {
> > >      /* not a lot to do in a standalone w/o threading! */
> > >  }
> >
> > That looks bizarre. What on earth is the compiler complaining about that
> > requires that kind of construct to shut it up?
> 
> -Wdeclarations
> 
> Basically, a public API function must have a declaration (prototype) prior to
> its definition.  In the main code, it does, in the header file, but the header
> files assume all sorts of stuff, such as the code is multithreaded.  This
> file uses main code, to avoid code duplication, but it does not need all of
> the fancy multithreaded functions (since it is a single-threaded utility), so
> it fakes out the dependencies with empty functions.
> 

Tilghman's right-- the other way I could have avoided warning messages
(which are fatal when you are in "dev-mode"), is to simply declare all
functions as static. But this is rarely helpful in a situation where you
might need to use some of those functions in another file. So, I did
what I did, and if a better way is found, and I have the time, I'll go
thru it again then. 

It's not easy, adapting asterisk code for standalone use! The number of
external references to various asterisk facilities is simply
breathtaking at times.

murf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3239 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20071120/a4047159/attachment.bin 


More information about the asterisk-dev mailing list