From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MtKmT-0002jK-EP for qemu-devel@nongnu.org; Thu, 01 Oct 2009 08:29:09 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MtKmO-0002eL-Kd for qemu-devel@nongnu.org; Thu, 01 Oct 2009 08:29:08 -0400 Received: from [199.232.76.173] (port=57753 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MtKmO-0002e7-6h for qemu-devel@nongnu.org; Thu, 01 Oct 2009 08:29:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49847) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MtKmN-0002yJ-P4 for qemu-devel@nongnu.org; Thu, 01 Oct 2009 08:29:04 -0400 Date: Thu, 1 Oct 2009 14:26:52 +0200 From: "Michael S. Tsirkin" Subject: Re: [Qemu-devel] [PATCH 4/9] pci: use uint64_t for bar addr and size instead of uint32_t. Message-ID: <20091001122650.GA9781@redhat.com> References: <1247656509-32227-1-git-send-email-yamahata@valinux.co.jp> <1247656509-32227-5-git-send-email-yamahata@valinux.co.jp> <20090930114122.GG18802@redhat.com> <20090930161547.GB21595@redhat.com> <20090930172641.GA28300@redhat.com> <20091001053302.GA3317@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Isaku Yamahata , qemu-devel@nongnu.org On Thu, Oct 01, 2009 at 04:15:59PM +0400, malc wrote: > On Thu, 1 Oct 2009, Michael S. Tsirkin wrote: > > > On Wed, Sep 30, 2009 at 09:59:11PM +0400, malc wrote: > > > On Wed, 30 Sep 2009, Michael S. Tsirkin wrote: > > > > > [..snip..] > > > > > > > > > > > _t suffix is reserved by POSIX. > > > > > > > > There's still no better naming for scalars. Worst case some platform > > > > will fail to compile, and we'll rename. > > > > > > > > > > Not good enough, if you are using something you have to abide the > > > constraints. > > > > So, posix does not reserve all of *_t namespace, it would negate years > > of C code. It simply says posix implementations can add only symbols > > ending with _t in the headers: this is a constraint on posix headers, > > not on applications that use them. Thus you have to find some other > > means to avoid conflict if you have symbols ending with _t. Using your > > module name as a prefix is a classical way to do this, for pci prefixing > > type name with pci_ should be enough to prevent any issues. > > I don't understand this at all. POSIX says that if you include any of > it's headers be prepared to deal with it, i.e. any of your own > typedefs that end with _t are potentially clashing with what's defined > there, In practice I don't expect any posix header to clash with michael_s_tsirkin_t even though in theory it might. So you can choose not to use any types that end with _t and have a guarantee that you won't clash with posix, and just name types sanely so they don't clash with posix in practice, on any platform people care about, like 99% of the world does. > similarly identifiers that start with 'str', 'E', double > underscore and underscore followed by a capital letter are reserved by > C, you just don't go there. I agree, double underscores look ugly enough to avoid them without a special reason, but for everyone reading C, *_t means "scalar type" and this benefit of using it outweights, IMO, the danger of potential clash with a header on a non-existing platform. > -- > mailto:av1474@comtv.ru