From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14499 invoked by alias); 28 Feb 2014 20:11:04 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 14425 invoked by uid 89); 28 Feb 2014 20:11:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Feb 2014 20:11:02 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1SKB0Mq021180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 28 Feb 2014 15:11:00 -0500 Received: from host2.jankratochvil.net (ovpn-116-18.ams2.redhat.com [10.36.116.18]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1SKAuGR010097 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Fri, 28 Feb 2014 15:10:58 -0500 Date: Fri, 28 Feb 2014 20:11:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org, Aleksandar Ristovski Subject: Re: [patchv3 1/8] Move utility functions to common/ Message-ID: <20140228201055.GA21879@host2.jankratochvil.net> References: <20140227213242.GB21121@host2.jankratochvil.net> <53107BBE.6040407@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53107BBE.6040407@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00887.txt.bz2 On Fri, 28 Feb 2014 13:06:22 +0100, Pedro Alves wrote: > On 02/27/2014 09:32 PM, Jan Kratochvil wrote: > > (hex2bin, bin2hex): Move decls from remote.h. > > This one looks stale. Yes, removed. > > --- a/gdb/common/common-utils.h > > +++ b/gdb/common/common-utils.h > > @@ -25,6 +25,25 @@ > > #include > > #include > > > > +/* Static target-system-dependent parameters for GDB. */ > > + > > +/* * Number of bits in a char or unsigned char for the target machine. > > + Just like CHAR_BIT in but describes the target machine. */ > > +#if !defined (TARGET_CHAR_BIT) > > +#define TARGET_CHAR_BIT 8 > > +#endif > > + > > +/* * If we picked up a copy of CHAR_BIT from a configuration file > > + (which may get it by including ) then use it to set > > Sounds like common-utils.h should include limits.h? defs.h does > include it. Primarily TARGET_CHAR_BIT and HOST_CHAR_BIT are obsolete, already C90 defines CHAR_BIT as constant 8. IIRC there was a discussion GDB could replace these macros by the number 8, simplifying a lot of code. Although IIRC there was agreement only on HOST_CHAR_BIT, that TARGET_CHAR_BIT may possibly differ in some cases (I do not believe it now, though). But I do not have the mail reference now. I have added there when the text references it. > > + the number of bits in a host char. If not, use the same size > > + as the target. */ > > + > > +#if defined (CHAR_BIT) > > +#define HOST_CHAR_BIT CHAR_BIT > > +#else > > +#define HOST_CHAR_BIT TARGET_CHAR_BIT > > +#endif > > I think host-defs.h might be a better home for this. (With the > target version placed in a new target-defs.h perhaps. I won't > insist though.) But I am not going to create new files because of an obsolete macro which should be in the first place deleted. Thanks, Jan