From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 87E1714A60F for ; Mon, 16 Feb 2026 22:21:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771280482; cv=none; b=IfUqNjeedJavNRHj13C5ufItN91TpaSBn7j2liTROB9AWn07XBRgaDO42DTtOepq+FbIUusOwJ9fjo4ixmGy4ayhIPV7O/p8lKh9vgFA7oBOwsiS0GkAZepb9Y4AznhfputLkzPEg5dM1D8qWItxbyGoscz8/yFKAGUzFkJMPHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771280482; c=relaxed/simple; bh=jZuFCB7mabybmPV74X4A7hT6nxWxeNJxy6PnInaeIWg=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FCJcmyWb2WuVBu+DUkQQ9xBtyEN1UY7PbAd6GRI3XtEHDqaTYySdF8gSWfrghmH1mP9Cpay81RvjEGoKpJ0EaPCti6VHUlLhI9/+qjSZXjwyW1LQlEzBZBqb2vY5BJyBsdYWET0yEwJ9aEFW1h75JVRsgW0K3EvqKqw0njk9oFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=FamxBiNA; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FamxBiNA" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-4327790c4e9so2680545f8f.2 for ; Mon, 16 Feb 2026 14:21:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771280480; x=1771885280; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=IO4cl9aFVWZkGWUvQJCl5DymH1DcIrMcptdlbr9lrMw=; b=FamxBiNA8xs8/z4nVbIguNBKc44C3ImRkZh/vq0IU7fVnrfWLiRAJuByxRWn8sIMPI s+HCvLcntIt0vLRbRhwKf5xQTLbhFPTB9h6LWHbSpuSJ0fvJcW+GnTUBBmKFVOZU6IjV FJVfKjIJTTcZVE8SM9W/QeGXPVpAzpVyrYzl58SA1R1gI9J3iFsY7X/daoE5ga3lp6Zj vOE/Nxk6oGHWP/uM3Zfedj5oyCnLeM4eBsjH5H5IBCalwmz0ggf3Dbb4cMCZv7ehqF/L 4ogPHL7kC4Xo+QA/NzfBP6YEsKWu149tEvYVvuoUEMOo4qr8IHzB+Y9gea7PctDlAfjE 4ALw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771280480; x=1771885280; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IO4cl9aFVWZkGWUvQJCl5DymH1DcIrMcptdlbr9lrMw=; b=KkXKEO7WT7qgMo6jeTmQkHHMW8m0Zkiax3ibgpyA2Uy1bwjlMUVLsnJNflDmRiAPY/ 5hknTvTsAY7TZIKzIAIIEJH7IVrBlB46rQ9Ff9uMMEDDyG4voIYloGSWfb901UmTvuHr ytRWbTg2/OSwut8tE2adiPoepuUug2ryS2uEfnIrJlSOKUFWIDAlHRkmvcbA9q77jSF7 a342mzSXuYtAxwK9v4o7YQlhRU1TaP4lfJn9O20Y2zhgCzb/Ugc8AriyGJfX46B/Rx64 e2S+CeVW8WBRmwJgjByPDVWJSuxuJaitMn/lOTkJklPKXCWe9egnpTZ8C0TSfXdzdzld 32Pg== X-Forwarded-Encrypted: i=1; AJvYcCUjRfZBriHrgq5mxv8ycMvbDx3vSFDAeYaIhAihZdCIVpAs2COg9quZOemybgCY/SilpQfeTbcgsdVyupI=@vger.kernel.org X-Gm-Message-State: AOJu0Yw/8+mSGPdmhzkOSRUXvpd1lO0iRX5qKDgmm9jno+oYKijY4gX5 /MXN0niWOeZsl7y3XlI4kAllyVZWx+8GctPliNNJqUj9GlcUfslhx8KS X-Gm-Gg: AZuq6aIStCk3CHUYQhI5g4o7YuUkbA79Drs3X6fDKPIQcEOtGceOWCYNXJDKnGrjVOb s3F6h7oJIjIOkWyl4XLAzzQprXxKs0oz4QZJdwU7wdea3/CZZK/iXBYQ3q0OlaDEGRsvLEAu8jJ 2JXNtugQinJjKJw2vMmEn0qofS46U5t+qnzSSAqNNSTSgxqL/UDl69ary9+TeQutPxG7yvJjmeb 8hpED3/5qIbHZWO/zTzkLquUhYSTenjzjlJy2tPwROBjlv92kelYm6s8XQIv6tjkHOOVqXDlH6e tSoED949qxek2hOypA/0uLuiNYAuhTXJh7ey8O7SM06WkdCCRWE/Fr2Ke/YhJ7X1skTgf1YWi0/ zCNY/dgL0gGgi+1CqwGkJtBP2Wx+SDKdYhZ3wmH3+OL+JjiCFJvN9o6caioHIConCgucTo7dAyA lFhlWXTUYBralxV1zo+aFNfJRN/SOb8Qbyqi8BjAqcwrKfJ/WpCjT3ArMzO7QOuPgZ X-Received: by 2002:a05:6000:1a8c:b0:435:8f1b:bb32 with SMTP id ffacd0b85a97d-43796aefc5cmr24275258f8f.32.1771280479740; Mon, 16 Feb 2026 14:21:19 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43796a5b2d1sm32504891f8f.4.2026.02.16.14.21.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Feb 2026 14:21:19 -0800 (PST) Date: Mon, 16 Feb 2026 22:21:18 +0000 From: David Laight To: Thomas =?UTF-8?B?V2Vpw59zY2h1aA==?= Cc: Willy Tarreau , linux-kernel@vger.kernel.org, Cheng Li Subject: Re: [PATCH] selftests/nolibc: Fix build with host headers and libc Message-ID: <20260216222118.5bc39904@pumpkin> In-Reply-To: <5f38b16b-1abf-4e22-92f1-9dc086c72e55@t-8ch.de> References: <20260214115724.3305-1-david.laight.linux@gmail.com> <5f38b16b-1abf-4e22-92f1-9dc086c72e55@t-8ch.de> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, 16 Feb 2026 19:51:24 +0100 Thomas Wei=C3=9Fschuh wrote: > On 2026-02-14 11:57:24+0000, david.laight.linux@gmail.com wrote: > > From: David Laight > >=20 > > Many systems don't have strlcpy() or strlcat(). > > Change is_nolibc to a #define so that the calls are optimised out. > > Create #define wrappers so the code is syntactially valid. > >=20 > > Additionall readdir_r() is likely to be marked deprecated. =20 >=20 > "Additionally" >=20 > > So disable "-Wdeprecated-declarations". =20 >=20 > Could you split this into multiple patches? >=20 > > Fixes: 6fe8360b16acb ("selftests/nolibc: also test libc-test through r= egular selftest framework") > > Signed-off-by: David Laight > > --- > > tools/testing/selftests/nolibc/nolibc-test.c | 13 +++++++++---- > > 1 file changed, 9 insertions(+), 4 deletions(-) > >=20 > > diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testi= ng/selftests/nolibc/nolibc-test.c > > index 1b9d3b2e2491..eb2421b42e75 100644 > > --- a/tools/testing/selftests/nolibc/nolibc-test.c > > +++ b/tools/testing/selftests/nolibc/nolibc-test.c > > @@ -66,13 +66,18 @@ static const char *argv0; > > /* will be used by constructor tests */ > > static int constructor_test_value; > > =20 > > -static const int is_nolibc =3D > > #ifdef NOLIBC > > - 1 > > +#define is_nolibc 1 > > #else > > - 0 > > +#define is_nolibc 0 > > +/* strlcat() and strlcpy() may not be in the system headers. */ > > +#undef strlcat > > +#undef strlcpy > > +#define strlcat(d, s, l) 0 > > +#define strlcpy(d, s, l) 0 > > +/* readdir_r() is likely to be marked deprecated */ > > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > > #endif =20 >=20 > I'd prefer to disable this via $(cc-option) in the Makefile. > Unknown pragmas tend to introduce more warnings. There is already a similar pragma in the file and this one isn't a new one = warning. The other option is to disable the test for !is_nolibc and #define readir_r= () away. That may not need is_nolibc changing to be a #define. David >=20 > > -; > > =20 > > /* definition of a series of tests */ > > struct test { > > --=20 > > 2.39.5 > > =20