Message ID | 20241003000408.1355549-1-raj.khem@gmail.com |
---|---|
State | Committed |
Headers |
Return-Path: <elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D5BFE385DDC1 for <patchwork@sourceware.org>; Thu, 3 Oct 2024 00:04:26 +0000 (GMT) X-Original-To: elfutils-devel@sourceware.org Delivered-To: elfutils-devel@sourceware.org Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id C8D323858C48 for <elfutils-devel@sourceware.org>; Thu, 3 Oct 2024 00:04:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C8D323858C48 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C8D323858C48 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727913855; cv=none; b=geOrT32WpWCk1+BYaAcSibiRp5guAVDQMInvtVVtFXD09N+udsxgrTOsVOTNqffhfKHkeNfz3bVtGOXcxOvEPxML79ndI1EDMPCV8fxLp3InHDCUI/MSIuSR3wgZdWQimZZ1RZVFMpA/hG8SiqmiUe8WSoATbOHHUXjknc+Ifjo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1727913855; c=relaxed/simple; bh=KJOtOQby+fYZM9LmqvPQiO6n1hC53/RVM5pfWFhfZd8=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=mLyUC/JAevkFoz4wpdICki+ll6DJhAJpY1tFxZi6HO8HwxTbvkrazpbasgujOi87Tb1/JnL5FK/pFTbuuSQfNctYLEzXhrXxMTZLfQK1GoV2/15VVawoxFuR2PKfZ/fC07wYQaoZo5JKSAd6h7woNO6Qezfgd+j6C9fQeI+imDU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-20b7259be6fso3067775ad.0 for <elfutils-devel@sourceware.org>; Wed, 02 Oct 2024 17:04:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727913852; x=1728518652; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=V9DHeFc1nOaqGC/pD7CCrPKhJtfDEA5oAlU73xouILY=; b=CT3YLkZYXqfHS9oIEBrdyMfbVy/6tA4SuKWwQIxCstyacLIA83Y/UCqGNuiaBndlH+ v+gnhHqZlqLjrQhNth1PZNoTN4cGLI9rcS9JxucqTrRfJOsoV3IK+Kk6k0jKjooTVf0Z QY+FwSFCx3MYSWOHy21sN/XIH8VkIMfAMsSwB1Jdux0qnmcK1uSsrCVEmCRKrUwjtmgs FIQgQ3JSwO8R1asavtuJBnJyOwPQuuHxj2LfVmBEnvlcipM0BCLTY0rRnDB0oO+fEI6Q vAFH55fdYsJ2x2kDV+ast2AiK4Puh7GYtkRh+vHINw6kK/OdxuJCKOXp5m0Iu8lu9C8W qXgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727913852; x=1728518652; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=V9DHeFc1nOaqGC/pD7CCrPKhJtfDEA5oAlU73xouILY=; b=J0Du21aY1sLun5pO56l7IIqrZY+mKh6FocgH8kXIUCXMSH3Ia1jxePgfgFZPdWKW6s hYEpy9veZw7P/eIEocTgjAKlvpb9wZFWcIV10jg2fHrjG/5oL1vBY3KZV2V87t+h7/SF mAmhx7068MKFAH9NDS4P5EWoRqaKDXEG8J28Cws4Pu0r9n6PCbqsiLrxGBjEvsNPh0XS bdL13hu9QXXhrs5NTGn68LKCXF1MV8Wm3XrUMM0CDJYLJ3+LCjm2YMHyG0IdDB0TJWzX l8GXDmWu+b4Po2H/NPCLBaP07rJL8cFX4NwH6Ny56cOex1wGC2HshYeiJIf8eZFH6JUv SECg== X-Gm-Message-State: AOJu0YyhnG4ob2+VXA+bhs9udYkF+PBYuNTuigKAqiA5zV7tJXp/K5vv n6Y0EiX2ywKZ99JLFOyJgzY/S+7p1Zj7cRJa27AB3bTQGErl5WsVYO8UqczL X-Google-Smtp-Source: AGHT+IEYzxqmQnXSkV/alJHXL6HZGsYMZF4urQiajA0Qhvvh8E2xHrbW3GlkHwmVsBAuex+0BoBSSQ== X-Received: by 2002:a05:6a21:4006:b0:1d4:fb32:d40c with SMTP id adf61e73a8af0-1d5db1a4447mr6869667637.4.1727913852420; Wed, 02 Oct 2024 17:04:12 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::1340]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7e6db628d96sm10503001a12.94.2024.10.02.17.04.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2024 17:04:11 -0700 (PDT) From: Khem Raj <raj.khem@gmail.com> To: elfutils-devel@sourceware.org Cc: Mark Wielaard <mark@klomp.org>, Khem Raj <raj.khem@gmail.com> Subject: [PATCH] tests: Fix specifying constant of double type Date: Wed, 2 Oct 2024 17:04:08 -0700 Message-ID: <20241003000408.1355549-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.46.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, 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: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Elfutils-devel mailing list <elfutils-devel.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/elfutils-devel/> List-Post: <mailto:elfutils-devel@sourceware.org> List-Help: <mailto:elfutils-devel-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/elfutils-devel>, <mailto:elfutils-devel-request@sourceware.org?subject=subscribe> Errors-To: elfutils-devel-bounces~patchwork=sourceware.org@sourceware.org |
Series |
tests: Fix specifying constant of double type
|
|
Commit Message
Khem Raj
Oct. 3, 2024, 12:04 a.m. UTC
'd' suffix seems to be not acceptable by clang compiler
Using 'e0' fixes this by keeping value to be same
Fixes
funcretval_test_struct.c:83:27: error: invalid suffix 'd' on floating constant
83 | dpoint_t dp = dmkpt (3.0d, 1.0d);
| ^
funcretval_test_struct.c:83:33: error: invalid suffix 'd' on floating constant
83 | dpoint_t dp = dmkpt (3.0d, 1.0d);
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
tests/funcretval_test_struct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Khem, On Wed, Oct 02, 2024 at 05:04:08PM -0700, Khem Raj wrote: > 'd' suffix seems to be not acceptable by clang compiler Funny, seems like the d suffix is an undocumented GNU extension that accidentially slipped in because an early/draft standard said 'd' stood for double, but that was not in the final standard paper. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84717 > Using 'e0' fixes this by keeping value to be same We could also have just dropped the suffix (no suffix means a double constant), since the exact value doesn't really matter in this testcase. But 'e0' certainly works. So pushed as is. Thanks, Mark
diff --git a/tests/funcretval_test_struct.c b/tests/funcretval_test_struct.c index df94bde0..6bf82f7d 100644 --- a/tests/funcretval_test_struct.c +++ b/tests/funcretval_test_struct.c @@ -80,7 +80,7 @@ main (void) div_t d = div (3, 2); ldiv_t ld = ldiv (3, 2); point_t p = mkpt (3.0f, 1.0f); - dpoint_t dp = dmkpt (3.0d, 1.0d); + dpoint_t dp = dmkpt (3.0e0, 1.0e0); return d.q - (int) p.y + ld.q - (int) dp.y; }