Date: Mon, 1 Feb 1999 20:30:01 -0800 (PST) From: Bruce Evans <bde@zeta.org.au> To: freebsd-bugs@FreeBSD.ORG Subject: Re: kern/9869: Addition to style(9) about usage of macro. Message-ID: <199902020430.UAA19727@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/9869; it has been noted by GNATS. From: Bruce Evans <bde@zeta.org.au> To: FreeBSD-gnats-submit@FreeBSD.ORG, shigio@wafu.netgate.net Cc: Subject: Re: kern/9869: Addition to style(9) about usage of macro. Date: Tue, 2 Feb 1999 15:21:56 +1100 > The following statement should be added to style(9). > > When using macros out of function, they should end with a semicolon. > > SYSINIT(placeholder, SI_SUB_DUMMY,SI_ORDER_ANY, NULL, NULL); > > Otherwise, ctags(1) and gtags(1) cannot recognize function definitions > collectly. Unfortunately, a semicolon after SYSINIT() is a (pedantic) syntax error. I don't think there should be a style rule about this. Instead, there should be rules about writing statement macros and declaration macros more carefully so that not having the semicolon is a (non-pedantic) syntax error. The usual method for statement macros is to wrap the macro in `do ... while (0)', and a not so usual method for declaration macros is to end the macro with `struct __hack'. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902020430.UAA19727>