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]
Date:	Thu, 01 May 2008 14:17:06 +0200
From:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Boaz Harrosh <bharrosh@...asas.com>,
	Harvey Harrison <harvey.harrison@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 09/10] misc: fix returning void-valued expression
	warnings

On Thu, 2008-05-01 at 13:00 +0100, Al Viro wrote:
> On Thu, May 01, 2008 at 02:43:50PM +0300, Boaz Harrosh wrote:
> 
> > I don't know who invented sparse, but I like this form of return.
> > 1 - It saves me the curly brackets and extra return line. But mainly
> > 2 - It is a programing statement that says: "Me here I'm an equivalent 
> >   to that other call". So if in the future that inner function starts
> >   to return, say, an error value, with the first style the compiler will
> >   error. But with the second style the new error return will be silently
> >   ignored. So these are not equivalent replacements. The former is a much
> >   stronger bond between the caller and the callie.
> 
> 3.  6.8.6.4(1): A return statement with an expression shall not appear in
> a function whose return type is void.
> 
> Write in C, please.

We use GNU99 all over the place, or are you going to clear up all the
statement expressions and such other fancy gnu extensions to the
language as well?

I'm really not seeing why this would be wrong, other than the standard
saying it is, ie. I think the standard got it wrong here.

Harvey can just use -Wno-return-void, or someone can modify sparse to
have that default disabled for STANDARD_GNU[89]9.

--
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