From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by sourceware.org (Postfix) with ESMTPS id 6FF273858D34 for ; Fri, 3 Jul 2020 10:43:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6FF273858D34 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wm1-f66.google.com with SMTP id l2so32108240wmf.0 for ; Fri, 03 Jul 2020 03:43:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Pomys6gMYs9DeH3awspC9q92UP1qTP45DrMeeEohX5w=; b=n/qmbErh62onnnPxfJWkGSXD/8AwapkYQ7bkVT/wc+OBUPpfSXPg9gS/kPtEuoExB9 UbcpEe+v++7iBihc0UBv9+fneljZ6ijIynns9z9H1vrGkjerD/PW+2LcYIagOIyDok4D fUI5j0s3UjDlRC2LZgBYEHcngtANJI7i1fhIeLUkBlhy2IQ9V2ijzgthh46kI3bCWJMK 99flXNO5RiIlMUUE9pkG/tSqJiiaPJGxs6jxc3PBCvODf/6nEQqmJH5rKCXl76ytDXHq C5rNRx3e0D8gVN8dihlEFipIQNmpqJZbMidQQTi2XVLmcvsfr1+9xO2S7TEWo9dLIFf5 cWdw== X-Gm-Message-State: AOAM5325ooQDRF682GGM61zv+T3a4n/LfenvMHl5sKb+tp08N4scCcN5 ElFampQGt/oZt+ql6I+DKC95mWOdboQc1g== X-Google-Smtp-Source: ABdhPJwBaIqimr+ISLyIAeWFDatBZieHorauX9Yl0F2Kz7yWVGEpMFQs7Jyn7DpDpmv1W+1aM+Rwaw== X-Received: by 2002:a7b:c041:: with SMTP id u1mr38059077wmc.56.1593773008900; Fri, 03 Jul 2020 03:43:28 -0700 (PDT) Received: from ?IPv6:2001:8a0:f922:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f922:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id 65sm12435093wmd.20.2020.07.03.03.43.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 03 Jul 2020 03:43:27 -0700 (PDT) Subject: Re: [PATCH] Make out of range type conversions explicit To: Gary Benson References: <1593525480-5685-1-git-send-email-gbenson@redhat.com> <20200703093018.GB8482@blade.nx> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <70597daf-9f55-fff8-6503-7602c204028a@palves.net> Date: Fri, 3 Jul 2020 11:42:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20200703093018.GB8482@blade.nx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Fri, 03 Jul 2020 10:43:32 -0000 On 7/3/20 10:30 AM, Gary Benson wrote: > Pedro Alves wrote: >> diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c >> index 7c8be035221..aac7bce8c15 100644 >> --- a/gdb/testsuite/gdb.base/structs2.c >> +++ b/gdb/testsuite/gdb.base/structs2.c >> @@ -13,7 +13,7 @@ main () >> >> bkpt = 0; >> param_reg (120, 130, 32000, 33000); >> - param_reg (130, 120, 33000, 32000); >> + param_reg (-120, 130, -32000, 33000); >> >> return 0; >> } > > On first glance I thought this was a copy-paste error. I don't think > it is, but, just in case, can you confirm the change above is what you > intended? What do you mean by "this"? If you mean, the proposed change instead of: param_reg (120, 130, 32000, 33000); - param_reg (130, 120, 33000, 32000); + param_reg (-130, 120, -33000, 32000); It's just that -130 and -33000 overflows, so I swapped the numbers back.