From: Andi Kleen <ak@suse.de>
To: 520047054719-0001@t-online.de (Oliver Neukum)
Cc: linux-kernel@vger.kernel.org
Subject: Re: ugly warnings with likely/unlikely
Date: 13 Jan 2002 18:27:54 +0100 [thread overview]
Message-ID: <p73r8ou2mat.fsf@oldwotan.suse.de> (raw)
In-Reply-To: <16PjOb-0oLbCCC@fwd11.sul.t-online.com.suse.lists.linux.kernel>
In-Reply-To: 520047054719-0001@t-online.de's message of "13 Jan 2002 13:25:57 +0100"
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)
next parent reply other threads:[~2002-01-13 17:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <16PjOb-0oLbCCC@fwd11.sul.t-online.com.suse.lists.linux.kernel>
2002-01-13 17:27 ` Andi Kleen [this message]
2002-01-13 18:26 ` ugly warnings with likely/unlikely Robert Love
2002-01-13 12:05 Oliver Neukum
2002-01-13 15:07 ` Alan Cox
2002-01-13 15:06 ` Oliver Neukum
2002-01-13 20:12 ` Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=p73r8ou2mat.fsf@oldwotan.suse.de \
--to=ak@suse.de \
--cc=520047054719-0001@t-online.de \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox