From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 176A53858438 for ; Mon, 18 Jul 2022 13:37:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 176A53858438 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-56-8OdvBRJaNLiFW9zGfghrCw-1; Mon, 18 Jul 2022 09:37:32 -0400 X-MC-Unique: 8OdvBRJaNLiFW9zGfghrCw-1 Received: by mail-wm1-f69.google.com with SMTP id a18-20020a05600c225200b003a30355c0feso3968691wmm.6 for ; Mon, 18 Jul 2022 06:37:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=juteIgm3HmvN/8vsrTv5+rNqBJx2ORrH3TdXXWwAhB0=; b=fXEuritKZ1G5/DZ1w2TrvZAUoRkFUJZPWBW0UWRxrin2bxzF+SnjMTaG+j3nbZsWvN KCXSa5/C9nPzctzsK/pybx0jMUsscTNRDTqNEtEfYysRV+LOnJvCL7ssxxhDUGI2eVaO wWUvL+M4VqdftyljOudnO/ml2gshs3CIGu3CRWfDoMf8FeFiAxC9FFWxl9cdGnDg6fR2 ljyR8n29aAVH6DgLb59i7j6DPv7imCuwHCqQyp62LCcqWfTTYwibpzeIbyqWuPFOW2ha 8N4HObF+AszNJ5vV0KlswPZEIxV8S/gs03eBlcAjN0oa266t2E1CJoevjdeQAQ5OJT/3 V2Ow== X-Gm-Message-State: AJIora9eqVrPj9GWwRYcaxcXxvjziwAN0owG3GRehcW07lJP/oQrLtXe j1I0CaSdMsg6G1EZlHjOrueZJOueFWuRWyxZJE2zeeWBi7MJMc820EPYIQKw+n1hoy4r5xPMQp+ xTi9gjFB/uMFsu5qKszu6Zw== X-Received: by 2002:a5d:584e:0:b0:21d:bca6:234d with SMTP id i14-20020a5d584e000000b0021dbca6234dmr22343078wrf.314.1658151450894; Mon, 18 Jul 2022 06:37:30 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uN74rDuNnRvCq6FllyDl0WIjJj+LjJ+q2FLmlXnE7VFyKqHVZ7t3xe2+7HbjLskiVx6ZhZRQ== X-Received: by 2002:a5d:584e:0:b0:21d:bca6:234d with SMTP id i14-20020a5d584e000000b0021dbca6234dmr22343061wrf.314.1658151450714; Mon, 18 Jul 2022 06:37:30 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id b12-20020adff90c000000b0021e150553acsm3386508wrr.14.2022.07.18.06.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 06:37:30 -0700 (PDT) From: Andrew Burgess To: "Willgerodt, Felix" , Bruno Larsen , "gdb-patches@sourceware.org" Subject: RE: [PATCH 1/1] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warnings. In-Reply-To: References: <20220608071717.3953324-1-felix.willgerodt@intel.com> Date: Mon, 18 Jul 2022 14:37:29 +0100 Message-ID: <871quisfs6.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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: Mon, 18 Jul 2022 13:37:41 -0000 "Willgerodt, Felix via Gdb-patches" writes: >> -----Original Message----- >> From: Bruno Larsen >> Sent: Mittwoch, 8. Juni 2022 14:59 >> To: Willgerodt, Felix ; gdb- >> patches@sourceware.org >> Subject: Re: [PATCH 1/1] gdb, testsuite: Adapt gdb.base/callfuncs.exp for >> new clang warnings. >> >> >> On 6/8/22 04:17, Felix Willgerodt via Gdb-patches wrote: >> > This patch fixes two issues with callfuncs.exp, which are both related >> > to new Clang warnings: >> >> Hi Felix! >> >> Thanks for this! >> >> > >> > 1) Clang 15.0.0 added a new warning for deprecated non-prototype >> functions: >> > https://reviews.llvm.org/D122895 >> > Callfuncs.exp is impacted and won't run due to new warnings: >> > >> > callfuncs.c:339:5: warning: a function declaration without a prototype is >> > deprecated in all versions of C and is not supported in C2x >> > [-Wdeprecated-non-prototype] >> > int t_float_values (float_arg1, float_arg2) >> > >> > This patch disables those warnings with -Wno-deprecated-non-prototype. >> > Removing the test for deprecated syntax would also be an option. But I will >> > leave that for others to decide. >> >> I like your solution with -Wno-deprecated-non-prototype. >> >> I think it is important (at least for now) to keep this test, since we have to >> support very old setups. >> >> > >> > 2) The other new warnings are about comparing a define with floats and >> doubles: >> > >> > callfuncs.c:518:1: warning: floating-point comparison is always true; >> constant >> > cannot be represented exactly in type 'float' [-Wliteral-range] >> > DEF_FUNC_VALUES_3(fc, float, crealf, cimagf) >> > >> > This can be fixed by making the define a float. >> >> Genuine question, would this not cause a problem for the times where the >> parameters are doubles and DELTA is a float? If it isn't a problem, I'm fine >> with this. >> > > I was wondering about that as well, but it still passes with GCC, clang and Intel > compilers and there are no compiler warnings about it. > I couldn't really figure it out if it would actually a problem somewhere. I could only > test on linux x86 though. My best guess was, as it is the "smaller precision" the > compiler will do the right thing. Indeed, my understanding of type promotion is that the compiler will promote the float argument to double or long double as needed. But then, prior to this patch, when DELTA was just (0.001), and would be considered a double, I would have expected, in any comparison between a float and DELTA, for the float to be converted to double, so I don't really understand that part of the original patch. Thanks, Andrew > But we could always add a DELTA that is double > as well. Hopefully someone else can chime in.