Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 13 Jan 2002 12:28:14 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 13 Jan 2002 12:28:05 -0500 Received: from ns.suse.de ([213.95.15.193]:60168 "HELO Cantor.suse.de") by vger.kernel.org with SMTP id ; Sun, 13 Jan 2002 12:27:56 -0500 To: 520047054719-0001@t-online.de (Oliver Neukum) Cc: linux-kernel@vger.kernel.org Subject: Re: ugly warnings with likely/unlikely In-Reply-To: <16PjOb-0oLbCCC@fwd11.sul.t-online.com.suse.lists.linux.kernel> From: Andi Kleen Date: 13 Jan 2002 18:27:54 +0100 In-Reply-To: 520047054719-0001@t-online.de's message of "13 Jan 2002 13:25:57 +0100" Message-ID: Lines: 20 X-Mailer: Gnus v5.7/Emacs 20.6 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 520047054719-0001@t-online.de (Oliver Neukum) writes: > Hi, > > if (likely(stru->pointer)) > > results in an ugly warning about using pointer as int. > Is there something that could be done against that ? Just use if (!stru->pointer) { ... } instead. gcc and a lot of other compilers predict all pointer tests against NULL as unlikely, unless you override that. -Andi (who is a bit worried about the unlikelies multiplicating like rabbits) - 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/