Package: pmacct
Severity: normal
Tags: patch

When building 'pmacct' on amd64 with gcc-4.0,
I get the following error:

cd . \
  && CONFIG_FILES=Makefile CONFIG_HEADERS= /bin/sh ./config.status
creating Makefile
make[1]: Leaving directory `/pmacct-0.7.4'
make[1]: Entering directory `/pmacct-0.7.4'
gcc -DPACKAGE=\"pmacctd\" -DVERSION=\"0.7.4\" -DHAVE_MMAP=1 -DHAVE_PCAP_H=1 
-DHAVE_LIBPCAP=1 -DPCAP_7=1 -DPCAP_TYPE_linux=1 -DHAVE_LIBMYSQLCLIENT=1 
-DWITH_MYSQL=1 -DWITH_PGSQL=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 
-DHAVE_GETOPT_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_TIME_H=1 -DRETSIGTYPE=void 
-DHAVE_INET_NTOA=1 -DHAVE_SOCKET=1  -I. -I.      -O2  -I/usr/include/postgresql 
-c pmacct.c
In file included from pmacct.c:24:
pmacct.h:145: error: array type has incomplete element type

With the attached patch 'pmacct' can be compiled
on amd64 using gcc-4.0.

This patch contains a patch which was already necessary with an earlier
version of gcc.

Regards
Andreas Jochens

diff -urN ../tmp-orig/pmacct-0.7.4/pmacct.h ./pmacct.h
--- ../tmp-orig/pmacct-0.7.4/pmacct.h   2004-08-27 14:15:42.000000000 +0200
+++ ./pmacct.h  2005-03-18 21:08:58.319414832 +0100
@@ -142,7 +142,6 @@
 extern int have_num_memory_pools; /* global getopt() stuff */
 extern struct configuration config; /* global configuration structure */ 
 extern struct plugins_list_entry *plugins_list; /* linked list of each plugin 
configuration */
-extern struct channels_list_entry channels_list[MAX_N_PLUGINS]; /* 
communication channels: core <-> plugins */
 extern pid_t failed_plugins[MAX_N_PLUGINS]; /* plugins failed during startup 
phase */
 #endif
 
diff -urN ../tmp-orig/pmacct-0.7.4/pkt_handlers.c ./pkt_handlers.c
--- ../tmp-orig/pmacct-0.7.4/pkt_handlers.c     2004-09-10 17:24:22.000000000 
+0200
+++ ./pkt_handlers.c    2005-03-18 21:10:21.503504341 +0100
@@ -27,6 +27,8 @@
 #include "plugin_hooks.h"
 #include "pkt_handlers.h"
 
+extern struct channels_list_entry channels_list[MAX_N_PLUGINS]; /* 
communication channels: core <-> plugins */
+
 /* functions */
 void evaluate_packet_handlers()
 {
diff -urN ../tmp-orig/pmacct-0.7.4/plugin_hooks.c ./plugin_hooks.c
--- ../tmp-orig/pmacct-0.7.4/plugin_hooks.c     2004-09-28 14:00:07.000000000 
+0200
+++ ./plugin_hooks.c    2005-03-18 21:09:16.365963333 +0100
@@ -179,7 +179,7 @@
 #else
        /* rg.ptr points to slot's base address into the ring (shared memory); 
bufptr works
           as a displacement into the slot to place sequentially packets */
-        (char *) pdata = 
channels_list[index].rg.ptr+ChBufHdrSz+channels_list[index].bufptr; 
+        pdata = 
channels_list[index].rg.ptr+ChBufHdrSz+channels_list[index].bufptr; 
 #endif
         while (channels_list[index].phandler[num] != NULL) {
           (*channels_list[index].phandler[num])(&channels_list[index], pptrs, 
pdata);


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to