From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6898 invoked by alias); 12 Oct 2003 16:08:04 -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 6888 invoked from network); 12 Oct 2003 16:07:58 -0000 Received: from unknown (HELO mx3.informatik.uni-tuebingen.de) (134.2.12.26) by sources.redhat.com with SMTP; 12 Oct 2003 16:07:58 -0000 Received: from juist (semeai [134.2.15.66]) by mx3.informatik.uni-tuebingen.de (Postfix) with ESMTP id 5E45A13E; Sun, 12 Oct 2003 18:07:57 +0200 (DFT) Received: from falk by juist with local (Exim 3.36 #1 (Debian)) id 1A8il8-0001aO-00; Sun, 12 Oct 2003 18:07:54 +0200 To: Jeff Sturm Cc: Andrew Morton , gcc@gcc.gnu.org Subject: Re: warning when a function's address is tested? References: From: Falk Hueffner Date: Sun, 12 Oct 2003 16:56:00 -0000 In-Reply-To: Message-ID: <87fzhyphgm.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/msg00421.txt.bz2 Jeff Sturm writes: > On Sun, 12 Oct 2003, Andrew Morton wrote: > > - 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? > > One legitimate use is to test for undefined weak symbols. But gcc knows that from __attribute__((weak)) and can suppress the warning in this case (like the C++ frontend does). -- Falk