Received: by 2002:ab2:6d45:0:b0:1fb:d597:ff75 with SMTP id d5csp102655lqr; Tue, 4 Jun 2024 23:27:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUFq+iXaOEhzUe0KDN8xvd/pdeQvtUn05Eeygy7Rx/5AA+URiqdoy4R9+1lmwaTntq3QVZqna/7K9soWWV1FKKU912Rdo7PtlKz66QpDw== X-Google-Smtp-Source: AGHT+IGAlls8ys+R6J/HsaTefuV9jn7o3cNQrWHxkWv5hroiEl72wxZZ4quJ7QC7lIaAtgcKDUFF X-Received: by 2002:a17:902:fc47:b0:1f6:8c90:3521 with SMTP id d9443c01a7336-1f6a5687203mr30295765ad.8.1717568838909; Tue, 04 Jun 2024 23:27:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717568838; cv=pass; d=google.com; s=arc-20160816; b=SgssB/BUYdE5wiG4a+rmACcHbWL9LIOdgfhoMaiBD0NGZPbXy3bcC115edr0w/5yJo 2pjzD3h/Vl0RqB1Fyg8ASGaSXtaHnus33Pih3GEWOZAmWWjXwZU9eX2ANrgZew9PMzOG r0yloId9XsqZOAb52mGqCmXdtY4PLq8MyAqXPpZ9o4zBORs6xRtZTPPnLcaJsH+DIcyZ vf0M+uyVVPu8u8p6AZqJvMj2pR7WPHNuGcnzzKs28TJZszyPYcuVeLcS2eV4TMwaiM1G P4OmvYbMgon2O+LqfncpfHiWLwyg0iA19ZWqOHg8GKOVS04/ftVnRszQSFa435uZfheP S7gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=jJicCfNI0XyT2KqlB8bA0RjXV0OEhoJl7DEuRKp7qYs=; fh=J8zeTsn92hB2UQSMgpjtEU9vYy/APTJoEmMcZIQ0P34=; b=m+WyXJ2ZAlMzMm61QWiWQVrEQBOxGRz0+vsasyf5z/C7unTr1m7x3yMxAnSW7yWxF5 ht5Ne17vCmpttM63ObqjsnGhTMoZ6CNU1UYxrCtdrFej4V8HFKJSa0tTS2wG+88bOIrS 0mQRS1TXbV+5+n/+l7y4X/QTMbiceE/IWdqbALZtJtDlpkq35ncWzOpVEEgEiadESDQX U9lBSGA82afx2pKCHR/PxIv522p6+kqPssuZR0zGQNiMfRiyJp2WpWrBWnFp8vwzpzVO x5Y2gE8OZJjvwjmfHC9KReGQeAhYh7bdtOYA515dTcEGs1c0gOcS8vMsFFY6cgZ9yczT 2/qg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sZiIOGz4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f63233d033si94611765ad.84.2024.06.04.23.27.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jun 2024 23:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-201806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sZiIOGz4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-201806-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-201806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6D3DA28304D for ; Wed, 5 Jun 2024 06:27:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 417803DABF6; Wed, 5 Jun 2024 06:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sZiIOGz4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F7E63DABE7; Wed, 5 Jun 2024 06:27:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717568834; cv=none; b=lcGyltRD/aWY4cO8eY5blCtyhoC9xjiq5bsosthsqhVxXQr8xV2ZISwoDeqH3qMnMdI5IzzJel6YLaGkcAikOpJ/3hBWvkaCl9JfT4b3Lim9VX/OZ3aXkq8cVdc9CXiZZ11/XWPZ3rsvtXQ4A+09pBjIRvlR9l7DdiIX4FVc924= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717568834; c=relaxed/simple; bh=Wd9zHKEWoslbcFRSGouPKc8Ft0c6guz9BhPzn40/nuM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iPPDug9y700z4G+rSZlMdObwzDSeKg8viWBSXMp6aIIaYYY/Tk9R5KKatjOtSm6u0I2HaWGr/fiX6XAVvfMlBPpP+zGHa+YMhGKdoDAd6p/6vxpCeyeO49LctMPvwDLKzW1EUjTNoML+61NBCG1WxD6n22VUHtCLMNM/A9IdSz4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sZiIOGz4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7580BC3277B; Wed, 5 Jun 2024 06:27:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717568834; bh=Wd9zHKEWoslbcFRSGouPKc8Ft0c6guz9BhPzn40/nuM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sZiIOGz4mAcMqlnKuBer+zLB4OUW3wdfc5gosaOSBEw1eL/POE2vzP7s0WNUWMtHV NENT1uic9AFL30H5ImFRf+cc48gSmBZiGejFv69bhfZEv704LjBZ3170vgq3QZB3kq ve2nk3H4BVGOkx0JY1pyez7Qws7SWdYg/1qU0/0zF9Wx6IDGDm9l+uKPXI3JDSzuaB wWnont51qD49rNlt3+HwY+R5H2PQCLFdaYLFxvGplL62pD6yl3wRyujWW+sEmY6ype GD3RV4aM/E9Ig3RfZOwqQJnXys9jE9ef5xvFiEitlcrlAwGk8pE6VrjT0wfBlko3oO jqGnnh1ga6tRw== Date: Tue, 4 Jun 2024 23:27:11 -0700 From: Nathan Chancellor To: Edward Liaw Cc: shuah@kernel.org, Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner , John Stultz , Stephen Boyd , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, llvm@lists.linux.dev Subject: Re: [PATCH] selftests/timers: Guard LONG_MAX / LONG_MIN defines Message-ID: <20240605062711.GG279426@thelio-3990X> References: <20240604231219.444603-1-edliaw@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240604231219.444603-1-edliaw@google.com> On Tue, Jun 04, 2024 at 11:12:18PM +0000, Edward Liaw wrote: > Add ifndef guards around LONG_MAX / LONG_MIN defines. When building with > Android bionic, these macros are redefined because bionic's time.h will > include linux/time.h, which includes limit.h. > > INFO: From Compiling common/tools/testing/selftests/timers/valid-adjtimex.c: > common/tools/testing/selftests/timers/valid-adjtimex.c:107:9: warning: 'LONG_MAX' macro redefined [-Wmacro-redefined] > 107 | #define LONG_MAX (~0UL>>1) > | ^ > prebuilts/clang/host/linux-x86/clang-r522817/lib/clang/18/include/limits.h:47:9: note: previous definition is here > 47 | #define LONG_MAX __LONG_MAX__ > | ^ > common/tools/testing/selftests/timers/valid-adjtimex.c:108:9: warning: 'LONG_MIN' macro redefined [-Wmacro-redefined] > 108 | #define LONG_MIN (-LONG_MAX - 1) > | ^ > prebuilts/clang/host/linux-x86/clang-r522817/lib/clang/18/include/limits.h:52:9: note: previous definition is here > 52 | #define LONG_MIN (-__LONG_MAX__ -1L) > | ^ > > Signed-off-by: Edward Liaw Reviewed-by: Nathan Chancellor > --- > tools/testing/selftests/timers/valid-adjtimex.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/tools/testing/selftests/timers/valid-adjtimex.c b/tools/testing/selftests/timers/valid-adjtimex.c > index d500884801d8..3d9f1baff86e 100644 > --- a/tools/testing/selftests/timers/valid-adjtimex.c > +++ b/tools/testing/selftests/timers/valid-adjtimex.c > @@ -102,8 +102,12 @@ long outofrange_freq[NUM_FREQ_OUTOFRANGE] = { > 1000 * SHIFTED_PPM, > }; > > +#ifndef LONG_MAX > #define LONG_MAX (~0UL>>1) > +#endif > +#ifndef LONG_MIN > #define LONG_MIN (-LONG_MAX - 1) > +#endif > > long invalid_freq[NUM_FREQ_INVALID] = { > LONG_MAX, > -- > 2.45.1.288.g0e0cd299f1-goog >