From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757524Ab2GKSOo (ORCPT ); Wed, 11 Jul 2012 14:14:44 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:56724 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754672Ab2GKSOn (ORCPT ); Wed, 11 Jul 2012 14:14:43 -0400 Message-ID: <1342030482.22278.8.camel@joe2Laptop> Subject: Re: [PATCH] Documentation/CodingStyle: Mention multi-line macros using expressions From: Joe Perches To: "Robert P. J. Day" Cc: Linux Kernel Mailing List Date: Wed, 11 Jul 2012 11:14:42 -0700 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2012-07-11 at 13:32 -0400, Robert P. J. Day wrote: [] > diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle [] > +A newer technique is to use the GCC extension of being able to place > +statements and declarations in an expression, as with this example from > +the header file: > + > +#define roundup(x, y) ( \ > +{ \ > + const typeof(y) __y = y; \ > + (((x) + (__y - 1)) / __y) * __y; \ > +} \ > +) Hi Robert. How about the phrase "GCC's statement expression extension" or maybe give a link like: http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html Please put the opening ({ and closing )} on a single line. It's shorter and makes grep easier. #define statement_expression(args) \ ({ \ etc \ })