From owner-freebsd-bugs Mon Aug 7 11:10: 8 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 9F13F37BDCC for ; Mon, 7 Aug 2000 11:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id LAA78235; Mon, 7 Aug 2000 11:10:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Mon, 7 Aug 2000 11:10:03 -0700 (PDT) Message-Id: <200008071810.LAA78235@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Johan Karlsson Subject: Re: kern/9869: Addition to style(9) about usage of macro. Reply-To: Johan Karlsson Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR kern/9869; it has been noted by GNATS. From: Johan Karlsson To: FreeBSD-gnats-submit@FreeBSD.ORG Cc: bde@FreeBSD.ORG Subject: Re: kern/9869: Addition to style(9) about usage of macro. Date: Mon, 07 Aug 2000 20:09:53 +0200 Hi Bruce Regarding MACRO in style(9) (see http://www.FreeBSD.org/cgi/query-pr.cgi?pr=9869) This is what the manpage says currently about MACRO:s =============== Macros are capitalized, parenthesized, and should avoid side-effects. Put a single tab character between the `#define' and the macro name. If they are an inline expansion of a function, the function is defined all in lowercase, the macro has the same name all in uppercase. If the macro needs more than a single line, use braces (`{' and `}'). Right-justify the backslashes; it makes it easier to read. If the macro encapsulates a compound statement, enclose it in a ``do'' loop, so that it can safely be used in ``if'' statements. Any final statement-terminating semicolon should be supplied by the macro invocation rather than the macro, to make parsing easier for pretty-printers and editors. #define MACRO(x, y) do { \ variable = (x) + (y); \ (y) += 2; \ } while(0) =============== Do you think that is enough or should it say anything more? If it is enough, I think this PR 9869 can be closed. Thanks Johan K To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message