Re: use inline functions instead of __statement

2018-01-04 Thread Joerg Sonnenberger
On Thu, Jan 04, 2018 at 09:35:36AM +1000, David Gwynne wrote: > these days you can use inline functions to get the same effect, but > it is a more obvious and standard language feature. If you want to go that way, you still should very likely mark the functions as always_inline, otherwise the

Re: use inline functions instead of __statement

2018-01-03 Thread Philip Guenther
On Wed, Jan 3, 2018 at 3:59 PM, Damien Miller wrote: > On Thu, 4 Jan 2018, David Gwynne wrote: > > > my theory is that __statement (a gcc extension) was used to allow > > macros to evaluate their argument(s) once by assigning it to a local > > variable, and then returning a

Re: use inline functions instead of __statement

2018-01-03 Thread Damien Miller
On Thu, 4 Jan 2018, David Gwynne wrote: > my theory is that __statement (a gcc extension) was used to allow > macros to evaluate their argument(s) once by assigning it to a local > variable, and then returning a value. this is difficult with normal > macros. Not understanding - doesn't this: >

use inline functions instead of __statement

2018-01-03 Thread David Gwynne
my theory is that __statement (a gcc extension) was used to allow macros to evaluate their argument(s) once by assigning it to a local variable, and then returning a value. this is difficult with normal macros. these days you can use inline functions to get the same effect, but it is a more