Hello,
On Wednesday 15 May 2002 23:06, Dotan Lior wrote: > Hi, > I'm trying to write a class in C++ that will retreive statistics from > iptable in order to find out the traffic on each rule in the NAT table. The > problem is that after including iptables.h whenever I'm compiling I get: > /usr/include/linux/netfilter_ipv4/ip_tables.h:295: ISO C++ forbids using > pointer of type 'void *' in pointer arithmetic > I'm running RH7.3 with iptables 1.2.5 The function is : /* Helper functions */ static __inline__ struct ipt_entry_target * ipt_get_target(struct ipt_entry *e) { return (void *)e + e->target_offset; } I probably didn't understand.. but is there any reason to explicitely cast the pointer to become a 'void *' when the declaration specifically says it is returning an 'ipt_entry_target *' ? Shouldn't it be casted to 'ipt_entry_target *' instead ? Sorry if didn't understand, but I'm just curious. Have a nice day, Fabrice. -- Fabrice MARIE Senior R&D Engineer Celestix Networks http://www.celestix.com/ "Silly hacker, root is for administrators" -Unknown