Summary:ASTERISK-05442: Compilation problem with chan_h323 at gcc 3.3.1 and higher
Reporter:pbd (pbd)Labels:
Date Opened:2005-11-03 17:55:26.000-0600Date Closed:2008-01-15 15:55:34.000-0600
Versions:Frequency of
Description:Due to changes in the channel.h and linkedlists.h header files that define macro AST_LIST_ENTRY in the chanspy structs, chan_h323 will NOT compile with gcc at 3.3.1 and 3.3.3 (possibly more).  JerJer's README states that it will compile at 3.2.2- but until now, newer has worked.  These changes have limited our compiler options to 3.2.2 until verified at other compiler levels.  If you attempt compilation, the following error results:
g++ -DNDEBUG   -I../../include -Wmissing-prototypes -fPIC  -DP_USE_PRAGMA -D_REENTRANT -Wall  -fPIC -I/usr/src/pwlib_v1_9_0//include -DPTRACING -I/usr/src/openh323_v1_17_1/include -M ast_h323.cxx >> ast_h323.dep
g++ -DNDEBUG   -I../../include -Wmissing-prototypes -fPIC  -DP_USE_PRAGMA -D_REENTRANT -Wall  -fPIC -I/usr/src/pwlib_v1_9_0//include -DPTRACING -I/usr/src/openh323_v1_17_1/include -Os  -pipe -felide-constructors -x c++ -c ast_h323.cxx -o ast_h323.o
ast_h323.cxx:1:1: warning: "_GNU_SOURCE" redefined
<command line>:4:1: warning: this is the location of the previous definition
In file included from ast_h323.cxx:45:
../../include/asterisk/channel.h:210: error: semicolon missing after struct
../../include/asterisk/channel.h:210: error: abstract declarator `
  ast_channel_spy::<anonymous struct>' used as declaration
../../include/asterisk/channel.h:210: error: namespace-scope anonymous
  aggregates must be static
make: *** [ast_h323.o] Error 1


The only workaround I have at this time is to use a second copy of channel.h in the channels/h323 directory, with the offending macro call commented out.  This works (so far as my initial testing is showing), based on chan_h323 not using the chanspy struct definitions.  We have a couple of possible long term resolutions here- one is to provide alternate header files for c++ compilation going forward, the other is to redefine the linked list macros in a way that avoids the problem for c++.
Comments:By: pbd (pbd) 2005-11-03 19:13:43.000-0600

Minor update.  At kpflemming's suggestion, tested with gcc4.02.  No dice- the openh323 header files (technically, the pwlib header files) that work with chan_h323 do not work under gcc4. So we're boxed in- I obviously can't try every version of gcc > 3.2.2, but it looks like we're pretty much relegated to 3.2.2 if we want chan_h323 to compile

By: Kevin P. Fleming (kpfleming) 2005-11-10 22:58:24.000-0600

Fixed in CVS HEAD by moving all chanspy-related stuff into chanspy.h. Tested with gcc-3.3.5 on SUSE Pro 9.3.

By: Digium Subversion (svnbot) 2008-01-15 15:55:34.000-0600

Repository: asterisk
Revision: 7068

U   trunk/ChangeLog
U   trunk/apps/app_chanspy.c
U   trunk/apps/app_mixmonitor.c
U   trunk/channel.c
U   trunk/include/asterisk/channel.h
A   trunk/include/asterisk/chanspy.h

r7068 | kpfleming | 2008-01-15 15:55:33 -0600 (Tue, 15 Jan 2008) | 2 lines

issue ASTERISK-5442