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

2011-12-20 Thread Jim Avera
Ok, here is a patch which improves the example: --- gcc/doc/extend.texi.ORIG    2011-12-20 17:35:32.236578828 -0800 +++ gcc/doc/extend.texi    2011-12-20 17:37:10.460583316 -0800 @@ -7932,7 +7932,7 @@    @smallexample  if (__builtin_expect (ptr != NULL, 1)) -  error (); +  ptr->do_something();  @e

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

2011-12-19 Thread Jim Avera
Hello, The online docs at http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Other-Builtins.html has a confusing (to me) example of __builtin_expect. Could someone take a look at this? Since you are limited to integral expressions for exp, you should use constructions such as if (__b