From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17203 invoked by alias); 12 Oct 2003 12:38:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 17195 invoked from network); 12 Oct 2003 12:38:06 -0000 Received: from unknown (HELO mx3.informatik.uni-tuebingen.de) (134.2.12.26) by sources.redhat.com with SMTP; 12 Oct 2003 12:38:06 -0000 Received: from juist (semeai [134.2.15.66]) by mx3.informatik.uni-tuebingen.de (Postfix) with ESMTP id 2CDA013E; Sun, 12 Oct 2003 14:38:03 +0200 (DFT) Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 1A8f4p-0007s5-00; Sun, 12 Oct 2003 14:11:59 +0200 To: Andrew Morton Cc: gcc@gcc.gnu.org Subject: Re: warning when a function's address is tested? References: <20031012050523.486faa69.akpm@osdl.org> From: Falk Hueffner Date: Sun, 12 Oct 2003 16:08:00 -0000 In-Reply-To: <20031012050523.486faa69.akpm@osdl.org> Message-ID: <87fzhyslip.fsf@student.uni-tuebingen.de> User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (cabbage) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-10/txt/msg00418.txt.bz2 Andrew Morton writes: > We just found a silly bug in the Linux kernel: > > - if (current_is_kswapd) > + if (current_is_kswapd()) > > It was there for a year. It is a fairly easy mistake to make, and > it would be nice if the compiler could generate a warning. I don't > think there are likely to be legitimate uses? Looks like a good idea. The C++ frontend already has this warning, so it shouldn't be too hard. -- Falk