ugly warnings with likely/unlikely
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 6 lines · [email protected] (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)
Quoted 1 line · Andi Kleen
-Andi (who is a bit worried about the unlikelies multiplicating like rabbits)
Indeed. People need to realize unlikely is not a free ride.
Robert Love