Possible wrong-way example in gcc4-4-2 documentation of __builtin_expect

Jonathan Wakely jwakely.gcc@gmail.com
Tue Dec 20 13:22:00 GMT 2011


On 20 December 2011 12:49, Segher Boessenkool wrote:
>
> The point of the example is that you cannot write
>
>          if (__builtin_expect (ptr, 1))
>            error ();
>
> so the "!= NULL" is important here.  But you are right that
> "error ()" is a bit unexpected; care to send a patch that changes
> it to e.g. "do_something ()"?

or even ptr->do_something() since that would depend on the value of ptr



More information about the Gcc mailing list