This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Style and Conventions: Multi-line function-like macro formatting.


On 01/18/2018 08:59 AM, Joseph Myers wrote:
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.

Likewise. Macros should try to be generally useful, so their bodies should avoid ({ ... }) or do-while if they can easily be stated in forms that could be useful in constant expressions.

Also, the commentary should mention that do-while is preferable to ({ ... }) in code that might be shared with Gnulib or other portable code, as ({ ... }) is not in the C standard.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]