From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-178.mta0.migadu.com (out-178.mta0.migadu.com [91.218.175.178]) (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 18DDC158205 for ; Fri, 3 May 2024 17:54:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714758847; cv=none; b=o+LEm7roQAG1GSdimGaR/5wlOzey3WMP3af/hTwRNe+7jpWKayg+QKDfRHxFTeCJ0LTCJG8uou/kikwwWVy6tXwrhMAVeiwnYNft8Aw22g4ZCelMd77XsLrbjg+yfB0d6JaEPpNcggkHS4EL/4HGnVmb6groeNk2kF5ISQYOaOk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714758847; c=relaxed/simple; bh=MmDr3BQCMFU+IxtuacVnHLexHCTvPtzyWCTkicg3BgI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=omES7LBbvsZVGEVqqp5QQxK5e6GnKWumFnhNgCPNps7tYSj4KG6OTzDrs2poLbouHmf2bKVYvfCoM5DObze9810q4gEhvjYh6+f/BU41gJjnwjp6lnB/XLRf2NucZzYglc2OK5rB0H8UeZecjW95NtP1064maBXlFayyAxczX1g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=ZctGSkb/; arc=none smtp.client-ip=91.218.175.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="ZctGSkb/" Date: Fri, 3 May 2024 10:53:52 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714758840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x0XQCMnsbYkYwtaS+30vq6EUAn0n4Ulc3+8JbTfZjrU=; b=ZctGSkb/BdmDJ3EmsYgUjqlACWFjy+wtUCPB5wpK9c5hQuQEhXvroesiWdCKe01cerZhl4 lZc2TSh3k0fCMjFNX3qYzv8AV5+b9Uo1RSM+OJL5ZuEQ1aSTBZwiQmRr7UjKQO5J6VIddu GriUkbStsO1LOxVEf7YwERAckrj4XkM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: John Hubbard Cc: Shuah Khan , Tejun Heo , Zefan Li , Johannes Weiner , Michal Hocko , Shakeel Butt , Muchun Song , Waiman Long , Yosry Ahmed , Nhat Pham , Chengming Zhou , Valentin Obst , linux-kselftest@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, LKML , llvm@lists.linux.dev Subject: Re: [PATCH 1/4] selftests/cgroup: fix clang build failures for abs() calls Message-ID: References: <20240503035105.93280-1-jhubbard@nvidia.com> <20240503035105.93280-2-jhubbard@nvidia.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: <20240503035105.93280-2-jhubbard@nvidia.com> X-Migadu-Flow: FLOW_OUT On Thu, May 02, 2024 at 08:51:02PM -0700, John Hubbard wrote: > First of all, in order to build with clang at all, one must first apply > Valentin Obst's build fix for LLVM [1]. Once that is done, then when > building with clang, via: > > make LLVM=1 -C tools/testing/selftests > > ...clang is pickier than gcc, about which version of abs(3) to call, > depending on the argument type: > > int abs(int j); > long labs(long j); > long long llabs(long long j); > > ...and this is causing both build failures and warnings, when running: > > make LLVM=1 -C tools/testing/selftests > > Fix this by calling labs() in value_close(), because the arguments are > unambiguously "long" type. > > [1] https://lore.kernel.org/all/20240329-selftests-libmk-llvm-rfc-v1-1-2f9ed7d1c49f@valentinobst.de/ > > Signed-off-by: John Hubbard Reviewed-by: Roman Gushchin Thanks!