From owner-cvs-src@FreeBSD.ORG Tue Aug 5 06:17:30 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3116E37B401; Tue, 5 Aug 2003 06:17:30 -0700 (PDT) Received: from hermes.aueb.gr (hermes.aueb.gr [195.251.255.142]) by mx1.FreeBSD.org (Postfix) with ESMTP id D7A0C43F85; Tue, 5 Aug 2003 06:17:28 -0700 (PDT) (envelope-from dds@aueb.gr) Received: from aueb.gr (faculty07.right.dialup.aueb.gr [195.251.255.251]) by hermes.aueb.gr (8.12.9/8.12.9) with ESMTP id h75DGsoj009505; Tue, 5 Aug 2003 16:16:54 +0300 Message-ID: <3F2FAE21.6EEB6309@aueb.gr> Date: Tue, 05 Aug 2003 16:16:17 +0300 From: Diomidis Spinellis Organization: Athens University of Ecomomics and Business X-Mailer: Mozilla 4.78 [en] (Windows NT 5.0; U) X-Accept-Language: en,el,de MIME-Version: 1.0 To: Johan Karlsson References: <200308050722.h757MCxl098780@repoman.freebsd.org> <20030805122815.GA17099@numeri.campus.luth.se> Content-Type: text/plain; charset=iso-8859-7 Content-Transfer-Encoding: 7bit cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: Diomidis Spinellis cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/dev/sym sym_fw.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Aug 2003 13:17:30 -0000 Johan Karlsson wrote: > On Tue, Aug 05, 2003 at 00:22 (-0700) +0000, Diomidis Spinellis wrote: > > dds 2003/08/05 00:22:12 PDT > > > > FreeBSD src repository > > > > Modified files: > > sys/dev/sym sym_fw.h > > Log: > > Remove extraneous semicolons. They are already provided by > > the macro definition, and cause the generation of syntactically > > incorrect code that gcc happens to accept. > > This is backwards. > > >From style(9): > Any final statement-ter- > minating semicolon should be supplied by the macro invocation rather than > the macro, to make parsing easier for pretty-printers and editors. > > Please consider reverting this and change the macros in the file to not > supply the terminating semicolon. I would certainly follow the style(9) guide if the existing code allowed it. This case is however more complicated. The same two 15-line macros (SYM_GEN_FW_[AB]) are used to specify structure member declarations and initializations: #define SYM_GEN_FW_B(s) \ SYM_GEN_B(s, no_data) \ SYM_GEN_B(s, sel_for_abort) \ SYM_GEN_B(s, sel_for_abort_1) \ ... SYM_GEN_B is defined as #define SYM_GEN_B(s, label) s label; in the include file for defining the structure members, and as #define SYM_GEN_B(s, label) ((short) offsetof(s, label)), in the C file for initializing the structures. Thus SYM_GEN_FW will always end with a semicolon or a comma. Also note that the terminator can not be specified as a macro argument. The two macros could be duplicated in semicolon-terminating and comma-separating versions (with the last separating/terminating element missing), but I believe this would be worse than the style rule violation. Other ideas welcome. Diomidis - dds@