From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 DB6CE1F8901 for ; Tue, 21 Jan 2025 22:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737499296; cv=none; b=GlbyZvSQ5TE3Z8lboui3gxbgxwANEPjT2x9PzzxmElZUACzyZbzVgdoNJYRUSZnYDUbtcyEQBoUy97w2oM4qs0raktgeo5uChHMnFUqYX+qP1nOGt7vXXpj2l08DJozebc0AN99sTrgFM6xTeJOrdibJpXdu2TJyC4Z/DZGQ2bc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737499296; c=relaxed/simple; bh=VV96BKA7n1T9Z9K5RS5gOsaZbYgfs/EtKzNGtrNnVDY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kNChE760KGjhkAgd6Cn+Ern1LJ4oSTP8bBUEvW/oQ1iR8ucCi6m5B8oVvKHuYsiJwicEZG2NQWSiyWaK6UTufmZTFmZ+3G8g/3x4Q4oT+quD6XDSJAblJA7vvlpK3dzujkyB2BDcuTa4Nc8Vci0cVStaA0g4DFcysgCXRZ7Oxl0= 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=jrP72nLT; arc=none smtp.client-ip=209.85.221.52 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="jrP72nLT" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-38a8b17d7a7so3187650f8f.2 for ; Tue, 21 Jan 2025 14:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737499293; x=1738104093; 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=/wELvxIWjZ3o1+myT7SjLWZTVBUHnTEeaocAhargmOc=; b=jrP72nLTwcZq+f+ias7tURZml8ZzBelwIc6oBTS7s2MD0Boos5iZbt/UEDVKIvYkOc VN5lKdpPH9lJ54DIWdpxeEa9Tkw7abmvpB5SyHiskxTNIiGhkN3Yzhy16npQ9u5zidnf KhBWtdRZVQnrJU5YKobP/61judkiHuA6bCDgsfBc/Q+AF935wRAtYpAaeKd+LI1Z6JPV N7WJ8B6VSMSBxnrFFZ25+Xfm3uQELOsGA4Gf1E1GlVlSBnZp5K/+PdPOrcAtf3ft8Ybp jzlcrbYnRPEEHepXY+cdYQq4dW3RdXaYK+xIZ7Xdqpe/FCgP3qvff8oCzT+KNqMFqKbi dgyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737499293; x=1738104093; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/wELvxIWjZ3o1+myT7SjLWZTVBUHnTEeaocAhargmOc=; b=SIUG38+WRcOWYT6mNfKh0y0KaICf/NAoPEULcfL9gG0QkdD0V43sIq9Ge/5sCt48wY qy7Eh37sUddW4eybVd0UBli68TjFl6LdzFZEXdm+IXo5/P91PNzDe+2agNojZbmrh7Uh 9UqR2Fpasq6/fHYMlT8n8e/HbW/HwBZsDQykt+fLAbElp2q8Sio+4d+ozvCbj6dD5hAk hAdzNRBQOVB/xP2hyjj18/mB/pzNIMNsW9D31RvbNPRIYT1+C4R7lugLjA8SBxmJDWgj X+QDyUk0LrZw1qaXREYy28ohsdCQzjzYEe+TwvAEn3ZAv/yFyLzzt39DBdNMKMtbmf1J OrTQ== X-Forwarded-Encrypted: i=1; AJvYcCXhNSGV0km37reJYKXf5qtab4Kqdt7nQ/M+owXfF3XM6yR6zhkPTbmsk4vfXky3UDbw4wfDI4/62QMfyZQ=@vger.kernel.org X-Gm-Message-State: AOJu0YycQTitpbdOiAXMld1CkaXTz6A+POsxKRfX8J3N4OqQSCrbHgPR iWP2f/8e6bYTczGafeXQAJ/kPijkfOGjx/jO1CdwogAYzy4Sb0N0 X-Gm-Gg: ASbGncuvftZJq1wzmUh7EQttLrQUVvEJMUF8fpmJLH24d2xaj7rCTfGw/5gYSI95LNY 0uWnXBektVzpGiL0Ox6tE+1sYaR3wHAOLb+9ZXOft20AAlPNCIU6cmqFbOdlzFGlf5Fm/Ua4Fzj yvKM4yhO7vH7rpLn8DSmeQdzJsJoVPF733pY2L1r1ZxWXQ7P9Gb0sShkbuNs7HaxftnB8AX1Pbd FGglBYp6eUCk1Zm43SC4r60zFr78kwCxugg2KQ7bfw08h11ncwUINPTAZLHI1eTOezeXNvFZPjP VtJQ25VeVIBYu3TNS6qYeQSPIy5/mgBU X-Google-Smtp-Source: AGHT+IE77RhxIfEBu84FoFSqZD9kaJn3Z+8Po/Qu+1cdf6gscxWiJK7G11SduoQGviebJ+sngk+vQg== X-Received: by 2002:a5d:6da1:0:b0:385:e411:c894 with SMTP id ffacd0b85a97d-38bf57a6844mr17710712f8f.43.1737499292924; Tue, 21 Jan 2025 14:41:32 -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-38bf3215066sm14818377f8f.11.2025.01.21.14.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 14:41:32 -0800 (PST) Date: Tue, 21 Jan 2025 22:41:31 +0000 From: David Laight To: Brahmajit Das Cc: dhowells@redhat.com, netfs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] cachefiles: fix build with GCC 15 Message-ID: <20250121224131.3845bfd7@pumpkin> In-Reply-To: <20250121221911.424a2003@pumpkin> References: <20250121091530.1316673-1-brahmajit.xyz@gmail.com> <20250121221911.424a2003@pumpkin> 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 Tue, 21 Jan 2025 22:19:11 +0000 David Laight wrote: > On Tue, 21 Jan 2025 14:45:30 +0530 > Brahmajit Das wrote: >=20 > > While building with GCC 15 I noticed these build error > >=20 > > fs/cachefiles/key.c:12:9: error: initializer-string for array of =E2=80= =98char=E2=80=99 is too long [-Werror=3Dunterminated-string-initialization] > > 12 | "0123456789" /* 0 - 9 */ > > | ^~~~~~~~~~~~ > > cc1: all warnings being treated as errors > >=20 > > This due to GCC 15 having enabled -Wunterminated-string-initialization > > by default[0]. Separating each characters to ensure NUL termination of > > char array. > >=20 > > [0]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-= unterminated-string-initialization > >=20 > > Signed-off-by: Brahmajit Das > > --- > > fs/cachefiles/key.c | 14 ++++++++------ > > 1 file changed, 8 insertions(+), 6 deletions(-) > >=20 > > diff --git a/fs/cachefiles/key.c b/fs/cachefiles/key.c > > index bf935e25bdbe..555a0ec9eff4 100644 > > --- a/fs/cachefiles/key.c > > +++ b/fs/cachefiles/key.c > > @@ -8,12 +8,14 @@ > > #include > > #include "internal.h" > > =20 > > -static const char cachefiles_charmap[64] =3D > > - "0123456789" /* 0 - 9 */ > > - "abcdefghijklmnopqrstuvwxyz" /* 10 - 35 */ > > - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* 36 - 61 */ > > - "_-" /* 62 - 63 */ > > - ; > > +static const char cachefiles_charmap[64] =3D { > > + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', /* 0 - 9 */ > > + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',= /* 10 - 35 */ > > + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', /* 10 - 3= 5 */ > > + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',= /* 36 - 61 */ > > + 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', /* 36 - 6= 1 */ > > + '_', '-' /* 62 - 63 */ > > +}; =20 >=20 > That is just horrid. > I think there is a attribute that stops the warning. > Or just convert to unsigned char []. Bah, neither works, but see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D= 117178 and https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671714.html If/when applied adding __attribute__((nonstring)) will disable the warning. In this case just changing the [64] to [65] will do no harm. But perhaps the warning should just be disabled for now. David >=20 > David >=20 >=20 > > =20 > > static const char cachefiles_filecharmap[256] =3D { > > /* we skip space and tab and control chars */ =20 >=20