Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932599AbWJFFie (ORCPT ); Fri, 6 Oct 2006 01:38:34 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932597AbWJFFie (ORCPT ); Fri, 6 Oct 2006 01:38:34 -0400 Received: from emailer.gwdg.de ([134.76.10.24]:22450 "EHLO emailer.gwdg.de") by vger.kernel.org with ESMTP id S932215AbWJFFia (ORCPT ); Fri, 6 Oct 2006 01:38:30 -0400 Date: Fri, 6 Oct 2006 07:34:05 +0200 (MEST) From: Jan Engelhardt To: Andrew Morton cc: "Moore, Robert" , Len Brown , "Brown, Len" , Linux Kernel Mailing List , ACPI List Subject: Re: [PATCH] Cast removal In-Reply-To: <20061005152608.b6a7fb27.akpm@osdl.org> Message-ID: References: <20061005152608.b6a7fb27.akpm@osdl.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Report: Content analysis: 0.0 points, 6.0 required _SUMMARY_ Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 38 >> I find this one interesting, as we've put a number of them into the >> ACPICA core: >> >> - (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? > >policy = not; > >But there's quite a lot of it in the tree. So what to do? GCC does not squawk, and instead has __attribute__((warn_unused_result)) in case someone should be made aware that a certain return value really needs to be examined. Not even the Turbo C/C++ compiler from 1990 requires either of from/to-void* or to-void casts. >Actually.. kmem_cache_destroy() returns void, so any checker which complains >about the missing cast needs a stern talking to. Ok, so the (void) can definitely go away for functions that actually return void, but what for the others? I am inclined that all lints should be fixed, or be sort-of discarded, since linting is slowly going back into [at least one] compiler. -`J' -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/