From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by sourceware.org (Postfix) with ESMTPS id 7468B3853578 for ; Wed, 8 Jun 2022 07:18:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7468B3853578 X-IronPort-AV: E=McAfee;i="6400,9594,10371"; a="256631318" X-IronPort-AV: E=Sophos;i="5.91,285,1647327600"; d="scan'208";a="256631318" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2022 00:18:16 -0700 X-IronPort-AV: E=Sophos;i="5.91,285,1647327600"; d="scan'208";a="683171824" Received: from mulvlfelix.iul.intel.com (HELO localhost) ([172.28.48.92]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2022 00:18:15 -0700 From: Felix Willgerodt To: gdb-patches@sourceware.org Subject: [PATCH 1/1] gdb, testsuite: Adapt gdb.base/callfuncs.exp for new clang warnings. Date: Wed, 8 Jun 2022 09:17:17 +0200 Message-Id: <20220608071717.3953324-1-felix.willgerodt@intel.com> X-Mailer: git-send-email 2.34.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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, 08 Jun 2022 07:18:24 -0000 This patch fixes two issues with callfuncs.exp, which are both related to new Clang warnings: 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. 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. --- gdb/testsuite/gdb.base/callfuncs.c | 2 +- gdb/testsuite/gdb.base/callfuncs.exp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c index d18d0dba073..cf7c75c1360 100644 --- a/gdb/testsuite/gdb.base/callfuncs.c +++ b/gdb/testsuite/gdb.base/callfuncs.c @@ -96,7 +96,7 @@ long double _Complex ldc3 = 3.0L + 3.0Li; long double _Complex ldc4 = 4.0L + 4.0Li; #endif /* TEST_COMPLEX */ -#define DELTA (0.001) +#define DELTA (0.001f) char *string_val1 = (char *)"string 1"; char *string_val2 = (char *)"string 2"; diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 4448cc127ba..d74357b8b48 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -18,7 +18,7 @@ standard_testfile -set compile_flags {debug} +set compile_flags {debug additional_flags=-Wno-deprecated-non-prototype} if [support_complex_tests] { lappend compile_flags "additional_flags=-DTEST_COMPLEX" } -- 2.34.3 Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928