This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Style and Conventions: Multi-line function-like macro formatting.
On Thu, Jan 18, 2018 at 11:59 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Thu, 18 Jan 2018, Carlos O'Donell wrote:
>
>> I have added my notes on the topic here in Style and Conventions.
>>
>> https://sourceware.org/glibc/wiki/Style_and_Conventions#Multi-line_function-like_macros
>>
>> Please feel free to tell me I'm wrong :-)
>
> I'm not aware of any preference for the ({ }) form unless you actually
> logically want an expression (for use within other expressions) rather
> than a statement.
I would put it stronger: ({ ... }) is a GCC extension that should be
_avoided_ unless absolutely necessary, when neither a do { ... } while
(0) block inside a macro nor an inline function will do the job.
zw