From owner-freebsd-arch@FreeBSD.ORG Wed Jun 1 15:06:52 2005 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6479316A41C for ; Wed, 1 Jun 2005 15:06:52 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CDC643D48 for ; Wed, 1 Jun 2005 15:06:52 +0000 (GMT) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.12.11) with ESMTP id j51F6h4k034071; Wed, 1 Jun 2005 08:06:43 -0700 (PDT) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id j51F6fXL034070; Wed, 1 Jun 2005 08:06:41 -0700 (PDT) (envelope-from rizzo) Date: Wed, 1 Jun 2005 08:06:41 -0700 From: Luigi Rizzo To: freebsd-arch@freebsd.org, delphij@delphij.net Message-ID: <20050601080641.H30391@xorpc.icir.org> References: <1117613456.771.16.camel@spirit> <20050601150344.GA39784@dragon.NUXI.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20050601150344.GA39784@dragon.NUXI.org>; from obrien@freebsd.org on Wed, Jun 01, 2005 at 08:03:44AM -0700 Cc: Subject: Re: [PATCH RFC] Add a macro for null mount options to sbin/mount* X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2005 15:06:52 -0000 On Wed, Jun 01, 2005 at 08:03:44AM -0700, David O'Brien wrote: > On Wed, Jun 01, 2005 at 04:10:56PM +0800, Xin LI wrote: > > Hi, -arch@, > > > > In our mount* utilities, the null mount option, which is usually be used > > as a terminator of an option vector, is defined with some hand-rolled > > terms, e.g.: {NULL}, {NULL, 0, 0, 0}, etc. > > > > I think it would be nice to have a new macro to deal with this, say, > > MOPT_NULL, which would be extended to {NULL, 0, 0, 0}, which can act as > > an explicit initialize. And in my opinion, something like: > > I think it is better to leave it alone. The "NULL" termination of a list > like this is a C idiom that should be clear to any C programmer. Hiding > the details in a macro (is MOPT_NULL an integer or a sentinel?) makes it > harder to see the idiom and know exactly what is going on and how this > list will be processed. on one side I have to agree here... however the alternative terms might cause problems with stricter compile flags (e.g. when some of the forms do not supply all fields), so perhaps a decent compromise could be to find a more explicative name such as MOPT_END or the like. cheers luigi > -- > -- David (obrien@FreeBSD.org) > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"