Summary:ASTERISK-05404: [patch] chan_agent.c doesn't compile
Reporter:Dinesh Nair (alphaque)Labels:
Date Opened:2005-10-31 02:52:33.000-0600Date Closed:2011-06-07 14:01:07
Versions:Frequency of
Environment:Attachments:( 0) chan_agent.c.patch
Description:chan_agent.c fails a compile due to wrong definition of AST_DECLARE_APP_ARGS with a trailing ';'. patch below fixes this by removing the trailing ';' in chan_agent.c.
Comments:By: BJ Weschke (bweschke) 2005-10-31 07:55:18.000-0600

What OS and version of gcc does it not compile under? I just compiled cvs-head from about 2 mins ago and chan_agent.c compiled fine.

By: Clod Patry (junky) 2005-10-31 11:49:24.000-0600

alphaque: which revision of chan_agent.c?
When reporting bug, please always add that information, that saves some time.

By: Dinesh Nair (alphaque) 2005-10-31 12:33:02.000-0600

apologies for leaving out the version numbers. it's file revision 1.164 and it was cvs'ed about 10 hours ago.

the bug shouldnt be OS dependent, as it's a compiler thing. gcc -v returns
gcc version 2.95.4 20020320 [FreeBSD]

in include/asterisk/app.h, AST_DECLARE_APP_ARGS is defined as such,

#define AST_DECLARE_APP_ARGS(name, arglist) \
struct { \
int argc; \
char *argv[0]; \
arglist \
} name;

while in chan_agent.c, it's used as such,


after the gcc preprocessor does it's thing, the expansion of the macro is left with two semicolons at the end. my patch removes the semicolon at the end of the AST_DECLARE_APP_ARGS block in chan_agent.c

a cvs diff done barely two minutes ago (against CVS HEAD) returned no changes to chan_agent.c since i checked out this afternoon, so it should still be there.

By: Russell Bryant (russell) 2005-10-31 13:55:50.000-0600

A quote from the README ...


 Ensure that your system contains a compatible compiler and development
libraries.  Asterisk requires either the GNU Compiler Collection (GCC) version
3.0 or higher, or a compiler that supports the C99 specification and some of
the gcc language extensions.