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] [day] [month] [year] [list]
Date:	Fri, 06 Oct 2006 22:39:13 +0200
From:	Arjan van de Ven <arjan@...radead.org>
To:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
Cc:	Muli Ben-Yehuda <muli@...ibm.com>,
	"Moore, Robert" <robert.moore@...el.com>,
	Andrew Morton <akpm@...l.org>, Len Brown <lenb@...nel.org>,
	"Brown, Len" <len.brown@...el.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	ACPI List <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH] Cast removal

On Fri, 2006-10-06 at 22:18 +0200, Jan Engelhardt wrote:
> >> -	(void) kmem_cache_destroy(cache);
> >> +	kmem_cache_destroy(cache);
> >> 
> >> I believe that the point of the (void) is to prevent lint from
> >> squawking, and perhaps some picky ANSI-C compilers. What is the overall
> >> Linux policy on this?
> >
> >IMHO there's another reason to do this which is much more relevant: it
> >tells the reader that whoever wrote it knows that it returns a value
> >and ignores it on purpose.
> 
> And GCC does not care about that, i.e. it still prints foritfy warnings, 
> as in:
> 
> $ svn co https://svn.sourceforge.net/svnroot/ttyrpld/trunk a && cd a
> $ make user/rpld.o EXT_CFLAGS="-D_FORTIFY_SOURCE=2"
> user/rpld.c:425: warning: ignoring return value of ‘write’, declared 
> with attribute warn_unused_result

this is by design. __must_check means you MUST do it.


-
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