2006-05-11 15:31:24

by Rik Bobbaers

[permalink] [raw]
Subject: fix compiler warning in ip_nat_standalone.c

hey all,

i just made small patch that fixes a compiler warning:

--- net/ipv4/netfilter/ip_nat_standalone.c~ 2006-05-11 03:56:24.000000000
+0200
+++ net/ipv4/netfilter/ip_nat_standalone.c 2006-05-11 17:17:22.000000000 +0200
@@ -219,8 +219,10 @@ ip_nat_out(unsigned int hooknum,
const struct net_device *out,
int (*okfn)(struct sk_buff *))
{
+#ifdef CONFIG_XFRM
struct ip_conntrack *ct;
enum ip_conntrack_info ctinfo;
+#endif
unsigned int ret;

/* root is playing with raw sockets. */

or at http://harry.ulyssis.org/ip_nat.diff

--
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT -=- Tel: +32 485 52 71 50
[email protected] -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


2006-05-11 15:58:47

by Jörn Engel

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
>
> i just made small patch that fixes a compiler warning:

Just in case Al didn't make it clear enough in the recent thread:

You cannot fix a compiler warning!

Either the code is wrong or it is right. A compiler warning can
indicate that code is wrong, or it is a false positive. If the code
is wrong, fix the _code_. If it isn't, ignore the warning or fix the
_compiler_.

That said, your patch looks as if it would actually fix the code. I'm
not firm enough with NAT to confirm that, though. So if it fixes the
code, please state exactly that.

J?rn

--
Anything that can go wrong, will.
-- Finagle's Law

2006-05-11 16:14:27

by Adrian Bunk

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, May 11, 2006 at 05:29:48PM +0200, Rik Bobbaers wrote:

> hey all,
>
> i just made small patch that fixes a compiler warning:
>...

Already fixed in Linus' tree since one week.

> harry
> aka Rik Bobbaers

cu
Adrian

--

"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed

2006-05-11 16:16:16

by Alexey Dobriyan

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, May 11, 2006 at 05:55:37PM +0200, J?rn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> >
> > i just made small patch that fixes a compiler warning:
>
> Just in case Al didn't make it clear enough in the recent thread:
>
> You cannot fix a compiler warning!

Calm down. It's pretty obvious from patch the warning is usual

"unused variable foo"

if CONFIG_BAR=n.

Anyway, fix in mainline already.

> Either the code is wrong or it is right. A compiler warning can
> indicate that code is wrong, or it is a false positive. If the code
> is wrong, fix the _code_. If it isn't, ignore the warning or fix the
> _compiler_.
>
> That said, your patch looks as if it would actually fix the code. I'm
> not firm enough with NAT to confirm that, though. So if it fixes the
> code, please state exactly that.

2006-05-11 16:18:49

by Al Viro

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, May 11, 2006 at 05:55:37PM +0200, J?rn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> >
> > i just made small patch that fixes a compiler warning:
>
> Just in case Al didn't make it clear enough in the recent thread:
>
> You cannot fix a compiler warning!
>
> Either the code is wrong or it is right. A compiler warning can
> indicate that code is wrong, or it is a false positive. If the code
> is wrong, fix the _code_.

Which is what the patch does, AFAICS. What's the problem in this case?

2006-05-11 16:49:44

by Rik Bobbaers

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thursday 11 May 2006 17:55, J?rn Engel wrote:
> On Thu, 11 May 2006 17:29:48 +0200, Rik Bobbaers wrote:
> > i just made small patch that fixes a compiler warning:
>
> Just in case Al didn't make it clear enough in the recent thread:
>
> You cannot fix a compiler warning!
>
> Either the code is wrong or it is right. A compiler warning can
> indicate that code is wrong, or it is a false positive. If the code
> is wrong, fix the _code_. If it isn't, ignore the warning or fix the
> _compiler_.

sry, i 'm not on lkml, so i didn't read the thread

> That said, your patch looks as if it would actually fix the code. I'm
> not firm enough with NAT to confirm that, though. So if it fixes the
> code, please state exactly that.

mkay... it fixes the code :)

--
harry
aka Rik Bobbaers

K.U.Leuven - LUDIT -=- Tel: +32 485 52 71 50
[email protected] -=- http://harry.ulyssis.org

"Work hard and do your best, it'll make it easier for the rest"
-- Garfield

Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

2006-05-11 18:31:27

by Jörn Engel

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, 11 May 2006 18:49:41 +0200, Rik Bobbaers wrote:
> On Thursday 11 May 2006 17:55, J?rn Engel wrote:
>
> > That said, your patch looks as if it would actually fix the code. I'm
> > not firm enough with NAT to confirm that, though. So if it fixes the
> > code, please state exactly that.
>
> mkay... it fixes the code :)

Ok. Then excuse my rant and thanks for the patch. :)

J?rn

--
To my face you have the audacity to advise me to become a thief - the worst
kind of thief that is conceivable, a thief of spiritual things, a thief of
ideas! It is insufferable, intolerable!
-- M. Binet in Scarabouche

2006-05-11 18:36:45

by Jörn Engel

[permalink] [raw]
Subject: Re: fix compiler warning in ip_nat_standalone.c

On Thu, 11 May 2006 17:18:46 +0100, Al Viro wrote:
> On Thu, May 11, 2006 at 05:55:37PM +0200, J?rn Engel wrote:
> >
> > You cannot fix a compiler warning!
> >
> > Either the code is wrong or it is right. A compiler warning can
> > indicate that code is wrong, or it is a false positive. If the code
> > is wrong, fix the _code_.
>
> Which is what the patch does, AFAICS. What's the problem in this case?

See subject. I didn't object to the patch, that looked fine to me.
But the general idea that a warning can be fixed always hits a loose
nerve in my brain. Maybe I'm a bit silly in this respect.

J?rn

--
When in doubt, use brute force.
-- Ken Thompson