lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1209594005.24729.127.camel@brick>
Date:	Wed, 30 Apr 2008 15:20:05 -0700
From:	Harvey Harrison <harvey.harrison@...il.com>
To:	David Miller <davem@...emloft.net>,
	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	akpm@...ux-foundation.org, jeff@...zik.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 07/10] net: fix returning void-valued expression
	warnings

On Wed, 2008-04-30 at 15:08 -0700, David Miller wrote:
> From: Harvey Harrison <harvey.harrison@...il.com>
> Date: Wed, 30 Apr 2008 15:03:43 -0700
> 
> > drivers/net/8390.c:37:2: warning: returning void-valued expression
> > drivers/net/bnx2.c:1635:3: warning: returning void-valued expression
> > drivers/net/xen-netfront.c:1806:2: warning: returning void-valued expression
> > net/ipv4/tcp_hybla.c:105:3: warning: returning void-valued expression
> > net/ipv4/tcp_vegas.c:171:3: warning: returning void-valued expression
> > net/ipv4/tcp_veno.c:123:3: warning: returning void-valued expression
> > net/sysctl_net.c:85:2: warning: returning void-valued expression
> > 
> > Signed-off-by: Harvey Harrison <harvey.harrison@...il.com>
> 
> I wish this weren't marked with a warning, what spits this out,
> sparse?

Yes, sparse warning.

> 
> I know the kernel is written in C and not C++, but even Stroustrup
> mentions this case explicitly in his book:
> 
> 	 A void function cannot return a value.  However, a call of a
> 	 void function doesn't yield a value, so a void function can
> 	 use a call of a void function as the expression in a return
> 	 statement.
> 
> And I see no reason why there's anything wrong with this construct.

Well, in an X86_32 allyesconfig, this only trips 32 times...so it's not
exactly common.  I agree that there is nothing _wrong_ with this, I'll
just add Linus and see if we can just call it codingstyle ;)

This is just a _trivial_ way to make the sparse output easier for people
to use day-to-day for the kernel. There's lots more to do, but this set
removes all remaining integer as NUll/ returning void-value/ single bit
signed bitfield warnings.

Cheers,

Harvey

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ