Re: Function attribute to indicate a likely (or unlikely) return value

2021-08-05 Thread Martin Liška
On 7/25/21 7:33 PM, Dominique Pellé via Gcc wrote: Hi Hello. I read https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html but was left wondering: is there a way to annotate a function to indicate that a return value is likely (or unlikely)? Interesting idea :) No,

Re: Function attribute to indicate a likely (or unlikely) return value

2021-07-25 Thread Gabriel Ravier via Gcc
On 7/25/21 7:33 PM, Dominique Pellé via Gcc wrote: Hi I read https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html but was left wondering: is there a way to annotate a function to indicate that a return value is likely (or unlikely)? For example, let's say we have this function: