From owner-freebsd-arch@FreeBSD.ORG Wed Jun 1 15:04:01 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 9D36816A41C for ; Wed, 1 Jun 2005 15:04:01 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (trang.nuxi.com [66.93.134.19]) by mx1.FreeBSD.org (Postfix) with ESMTP id 640BA43D49 for ; Wed, 1 Jun 2005 15:04:01 +0000 (GMT) (envelope-from obrien@NUXI.com) Received: from dragon.NUXI.org (obrien@localhost [127.0.0.1]) by dragon.NUXI.org (8.13.3/8.13.3) with ESMTP id j51F3jc1009032; Wed, 1 Jun 2005 08:03:45 -0700 (PDT) (envelope-from obrien@dragon.NUXI.org) Received: (from obrien@localhost) by dragon.NUXI.org (8.13.3/8.13.1/Submit) id j51F3iKx009031; Wed, 1 Jun 2005 08:03:44 -0700 (PDT) (envelope-from obrien) Date: Wed, 1 Jun 2005 08:03:44 -0700 From: "David O'Brien" To: delphij@delphij.net Message-ID: <20050601150344.GA39784@dragon.NUXI.org> Mail-Followup-To: freebsd-arch@freebsd.org, delphij@delphij.net References: <1117613456.771.16.camel@spirit> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1117613456.771.16.camel@spirit> X-Operating-System: FreeBSD 6.0-CURRENT Organization: The NUXI BSD Group X-Pgp-Rsa-Fingerprint: B7 4D 3E E9 11 39 5F A3 90 76 5D 69 58 D9 98 7A X-Pgp-Rsa-Keyid: 1024/34F9F9D5 User-Agent: Mutt/1.5.9i Cc: freebsd-arch@FreeBSD.org 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 Reply-To: freebsd-arch@FreeBSD.org 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:04:01 -0000 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. -- -- David (obrien@FreeBSD.org)