All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Welte <laforge@gnumonks.org>
To: Scott Andrew Baillie <sbaillie@bigpond.net.au>
Cc: netfilter List <netfilter-devel@lists.netfilter.org>
Subject: Re: ip_tables.h does not compile when using g++
Date: Sun, 15 Sep 2002 13:20:07 +0200	[thread overview]
Message-ID: <20020915132007.H3810@sunbeam.de.gnumonks.org> (raw)
In-Reply-To: <1032005243.9337.19.camel@localhost.localdomain>; from sbaillie@bigpond.net.au on Sat, Sep 14, 2002 at 12:07:22PM +0000

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

On Sat, Sep 14, 2002 at 12:07:22PM +0000, Scott Andrew Baillie wrote:
> The file linux-2.4.19/include/linux/netfilter_ipv4/ip_tables.h is
> included by user space programs as well as the kernel, hence I think
> that it should compile using g++.

You are right.

> This patch makes it compile. Patch is also attached.
> 
> 
> diff -ur linux-2.4.19/include/linux/netfilter_ipv4/ip_tables.h
> linux-2.4.19-new/include/linux/netfilter_ipv4/ip_tables.h
> --- linux-2.4.19/include/linux/netfilter_ipv4/ip_tables.h	Mon Feb 25
> 19:38:13 2002
> +++ linux-2.4.19-new/include/linux/netfilter_ipv4/ip_tables.h	Sat Sep 14
> 11:11:01 2002
> @@ -292,7 +292,7 @@
>  static __inline__ struct ipt_entry_target *
>  ipt_get_target(struct ipt_entry *e)
>  {
> -	return (void *)e + e->target_offset;
> +	return ((struct ipt_entry_target *)((char *)e + e->target_offset));

why does it have to be (char *) ? There are no characters involved, hence
it (in the spirit of this gcc extension) should be (void *).

The typecast to struct ipt_entry_target is correct, however.

Does it compile with 

	return ((struct ipt_entry_target *)((void *)e + e->target_offset));

If yes, I will submit this modified version of  your patch.

> Regards,
> Scott.



-- 
Live long and prosper
- Harald Welte / laforge@gnumonks.org               http://www.gnumonks.org/
============================================================================
GCS/E/IT d- s-: a-- C+++ UL++++$ P+++ L++++$ E--- W- N++ o? K- w--- O- M+ 
V-- PS++ PE-- Y++ PGP++ t+ 5-- !X !R tv-- b+++ !DI !D G+ e* h--- r++ y+(*)

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2002-09-15 11:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-14 12:07 ip_tables.h does not compile when using g++ Scott Andrew Baillie
2002-09-15 11:20 ` Harald Welte [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-09-16 14:12 Scott Andrew Baillie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020915132007.H3810@sunbeam.de.gnumonks.org \
    --to=laforge@gnumonks.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=sbaillie@bigpond.net.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.