From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 4FC00158208 for ; Fri, 3 May 2024 17:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714758845; cv=none; b=aDY/etx/5qavlROfArpErHrSF6FzoNdYCEmgFd593yIwoEiy7JgSqo3AHSNp/kP8nnAxwo0BAZ/mJEc+r9yyhr4lZU6FWpBtNtFhdCAUbt16HhUOU8xgad0tIvFP55jGjAyMHJtcGcmlN5MMm5/vh3tJuLBd4WUe/piAN+fGzsM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714758845; 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=Sz0ItzcrOC2nQx8N8oaoGOxVa6Z8rrNCQxUp6irmHU76k16m8tZ7sBEEB+2ONMY9Uirg07XqnM3gzgraKMeBk49DJ9gGGuuTUe/BLb0bgnorJrKnHkOfDiegcHMHEYJuQ5M3Tbf5BFVt9nUZgHvA/Qcox5cGh4oWZPiRdEFkAN4= 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.172 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: cgroups@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!