From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 110201 invoked by alias); 31 Jan 2020 16:52:41 -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 110193 invoked by uid 89); 31 Jan 2020 16:52:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: simark.ca Received: from simark.ca (HELO simark.ca) (158.69.221.121) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 31 Jan 2020 16:52:40 +0000 Received: from [172.16.0.95] (192-222-181-218.qc.cable.ebox.net [192.222.181.218]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 3BA6E1E059; Fri, 31 Jan 2020 11:52:38 -0500 (EST) Subject: Re: [PATCH 1/2] gdbsupport: Fix a type of sentinel To: Tom Tromey Cc: Lukas Durfina , gdb-patches@sourceware.org References: <20200128142830.89282-1-ldurfina@tachyum.com> <875zgsym2f.fsf@tromey.com> From: Simon Marchi Message-ID: <0f8d6a4e-e5c9-9002-856b-c872299f196f@simark.ca> Date: Fri, 31 Jan 2020 18:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <875zgsym2f.fsf@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2020-01/txt/msg01003.txt.bz2 On 2020-01-31 5:09 a.m., Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> Can you please indicate in your commit message the reason why you need this > Simon> change? I presume it fixes some compilation error, in which case please > Simon> indicate at least what is the error message and what is the compiler you are > Simon> using (name and version). If you are cross compiling, it can also be good > Simon> to mention that as well. > > The bug here is that if NULL is defined as 0, then the sentinel will be > handled incorrectly via varargs if sizeof(void*) > sizeof(int) -- the > value passed in will be narrower than what the callee reads. Jan did a > pass once, ages ago, to fix all of these, but it's easy for new ones to > slip in, since it's not always incorrect. Ok thanks, I didn't know about that. I think that this information should end up in the commit message. > I like the nullptr idea. Also replacing concat calls with std::string > in appropriate spots seems like a good idea too. Indeed. Simon