From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 89A251F55F0 for ; Tue, 21 Jan 2025 22:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737497956; cv=none; b=D1fcXVAAguUBQ7yjgcorLJWOgCjCB2K0A5c8z8Xfz4E72Q3fkOoTs1ZjKElCL6BNmrl4AJD96FZrDDwJkNMFLtwVRhJBpEnw21Fglr6u4zMULgkcU7M26S8D7nvIqqFQLU5eZfZ2MqTPJYjKCjANFcWxPLq7a1ZjVOCT+sxH6Pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737497956; c=relaxed/simple; bh=n1gw9wqSpzGGWq3ON8IDLwgsArUOIACfgtrnjL2ECYc=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TVlH/Jjg4oyh1JlMUHHXHSlyHb5rcbFzFQHgjavBalzTHXJPhF9hqb429k4lIkTAouGyTpO2ScCtOdRAhh9PDYmvSmuP92GFwwavc9+4jEzXqRVekaCYyMIwMCwRE2tSfVAmDZtvB2kGqfFEv+Y9gfIW8c3TwtmMpEx88h4kJEo= 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=KvOEisr2; arc=none smtp.client-ip=209.85.128.41 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="KvOEisr2" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4361b6f9faeso1584285e9.1 for ; Tue, 21 Jan 2025 14:19:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737497953; x=1738102753; 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=nNy6Fc2BkHYA7xaM8m7c/fElG1Q5tjJMMXzKaihomq0=; b=KvOEisr2LymYn7HUfZ6TtMV+jvWkmZSwncRcgXqAF9r85A7Sqw3Wv6SzM7DhDhddnr 7Kae1ilm88sG+Tw2/YCMFDUl1ZocPJE0tpSBnKhZKqMORDXunfYFt/XA0O7rAU0MwUgj KPDB2uUQAwij+OvGRDM/cwBuOOavvxjmoQ0/F0YzMXLErSXxkvTpVIhD0frWZjYEmsXQ e58U6c0Z9lycGT8K4vKOE8XUyd4xHhZYWIG54ltJ8UEkkvO+3fNdkQjHd3Z1svzjbyUQ MzlD+KT9w4I2e+NJYHzEIpnzW8hLBdbZzRi26N8GwaKV5MRUQbERZEZoJ+tgrHAMIOdq uXiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737497953; x=1738102753; 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=nNy6Fc2BkHYA7xaM8m7c/fElG1Q5tjJMMXzKaihomq0=; b=d2NmCYw+6HE1KDno2KDXz96wlaUqd4ZM1kF04vDZLyTBZCfah7ZzXcERDAdGx3a3rY hiM8FAx54HYEiFDksfmHz+z35CXqIYTKBfFW3unaJO3LuZfYhdyzmZRB1LsZpQXi/byt T/gMqCzCduMF4UYP+cMbc3RCjQ+mf+s6fUa7sKfR5jMk5PNbtDqDt4phoaZW3ZAzEScv 8JoGxnPtRs/QuA5bVUxYeZB2eCJzEX54YIRTacv7GJYSgAyU/gIxpg1P3N3BOliHRUS+ uDybtpeOJIXzcTB2LyfYJeMlSsxVuCdpRyzxlyqb8trjBZ+yBbVCo72aecLAEUcO2L50 n9ag== X-Forwarded-Encrypted: i=1; AJvYcCUiqwPUYh5bHwqPXMKuYeVfsdNYauDC2modkwJ9ZSZBL9feSRxNBMHHmuhI6NAFo1tDJl22EzF3uzxLT9E=@vger.kernel.org X-Gm-Message-State: AOJu0YxflNBT7AyDDABs716RYcj1/4i9bm8JFo1vc7vC5Eqp9Ybx3qpz /LlcjiyuXYgl00gXePLOg7N9rIcS7Rx9Lundnz/MyJd6dPpUND54IP/UqA== X-Gm-Gg: ASbGncvE8Dq8H6jj0oLsvj/ic90U/4QIFX0Hgzx17QEuf5Nzbt0UtFyr5cPO4GKdcWK rX7/lGO1699zql78XvUFvX+fpLChdkhwz+DReH5cYT1DkBinscKsUqIk/7Jqi7eDyI3eHK/vWuZ 5gazlF30piA+uKowAmDfcWNZwzgUwWwygaaCyeoNB4rG8h8c/znkswMuhp+uZNSZlcpE82lh/Bx 8LDyOzwkqpTThWzi0bdyRX5xm+Lsy4xQ9XpzUP0imALeOd6acFoxoHdPiZuCQRhiqLdO04Jd09q bYrIKPUy8AOjk8VZtoMLgURAeYz//NgS X-Google-Smtp-Source: AGHT+IHIgbIfwQDQLiYa07yfjF82SfjSsag0JxwnWSQVgMqdbqxu96UMDMUi8f/mhZvd6kAqM+654w== X-Received: by 2002:a05:600c:1d0f:b0:435:edb0:5d27 with SMTP id 5b1f17b1804b1-437c6afdc92mr260136185e9.9.1737497952576; Tue, 21 Jan 2025 14:19:12 -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 5b1f17b1804b1-438b31d987csm124405e9.27.2025.01.21.14.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 14:19:12 -0800 (PST) Date: Tue, 21 Jan 2025 22:19:11 +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: <20250121221911.424a2003@pumpkin> In-Reply-To: <20250121091530.1316673-1-brahmajit.xyz@gmail.com> References: <20250121091530.1316673-1-brahmajit.xyz@gmail.com> 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 14:45:30 +0530 Brahmajit Das wrote: > 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-un= terminated-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 - 35 = */ > + '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 - 61 = */ > + '_', '-' /* 62 - 63 */ > +};=20 That is just horrid. I think there is a attribute that stops the warning. Or just convert to unsigned char []. David > =20 > static const char cachefiles_filecharmap[256] =3D { > /* we skip space and tab and control chars */