From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id A1B8B3858C52 for ; Wed, 21 Sep 2022 17:00:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1B8B3858C52 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id E12981E0D3; Wed, 21 Sep 2022 13:00:02 -0400 (EDT) Message-ID: Date: Wed, 21 Sep 2022 13:00:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 3/4] gdb: add type::length / type::set_length Content-Language: en-US To: Tom Tromey , Lancelot SIX via Gdb-patches Cc: Simon Marchi , Lancelot SIX References: <20220916150836.527213-1-simon.marchi@efficios.com> <20220916150836.527213-3-simon.marchi@efficios.com> <20220921150144.s62znyu4ws356aro@ubuntu.lan> <87leqc3cfb.fsf@tromey.com> From: Simon Marchi In-Reply-To: <87leqc3cfb.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Sep 2022 17:00:04 -0000 On 2022-09-21 12:44, Tom Tromey wrote: >>>>>> "Lancelot" == Lancelot SIX via Gdb-patches writes: > >>> - TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; >>> + array_type->set_length ((array_bitsize + 7) / 8); > > Lancelot> Do you think that while at it you could also replace the 7 and 8 > Lancelot> literals with appropriate configured values? > > ... > Lancelot>   / HOST_CHAR_BIT); > > Normally I think the '8' is a target value, not a host value. > Like, if HOST_CHAR_BIT != 8, would this do the wrong thing? Sorry, Lancelot, I missed your message before pushing. In any case, I wouldn't have done this change in that patch, as it's orthogonal. I wouldn't worry about HOST_CHAR_BIT every being anything other than 8. Simon