From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 B84001A2C11 for ; Tue, 21 Jan 2025 09:15:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737450946; cv=none; b=Phs5kJrBp54PcRrCTL1evmcbC+E3Bpj9u70p8lAApP6eCSWz4JWZ88Eb9GeAVyd5I2Yj4mTAKHFAVTkkr9oRfJ78dK/3P+0U9Fx6KJGq5v8qcxI6s4BrmqcBApv2zfmJXypGG7z8a4Va8zF9cMqKA5/tIBgtN6PDyXetPw9U8Lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737450946; c=relaxed/simple; bh=RuaT4xPijv44lUK1hbsotQqEH8CiQkMR8xW9uc1Q69s=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=l30tOr1XeRLB/kxYOqr5gznn61Uvwkq26omu3jmU5P6IeWRDi6ZcxaMxgVXKKRQtvfJsDKRptJeTjpqYr1e34eqoXbC6EJNSJ96ttNpzb5V25HmKpfBjlG627Jtqc6oe9f587Ea1sMrh4Z8FL+n9HO7Yiwhw1Q0KJSt52vRy0Hs= 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=PGLv1Pra; arc=none smtp.client-ip=209.85.221.48 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="PGLv1Pra" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-385d7f19f20so2626301f8f.1 for ; Tue, 21 Jan 2025 01:15:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737450943; x=1738055743; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Ev8a20hhFB0PtqA6Uck4JlPKU7F6frnJcxqcXRltDqo=; b=PGLv1PraSHu9fWQhXHvZcBDpRtx4TYHK+Y5edy1g4CjhVHv5OtNWDn5gDJEEUNpTSc ezXUa1+2ITi4i9v134y76xcml2vW6G4NDLvwiuutevGT6MzKNFepBJrnXeo52r46N66U 17zFNucFjJvSkclqqbJvwEn0C1tHQuZYxXV66GfPXGy0NeHxBFQltu9YaDZo6jqu18+q Homadl1Sd0oCkJOQP49KfTH+SvFlH1RlrI+PzQ88wcxrew4e3xLVZl70ymBLsqXds5iy KA4oXPFn8cUaGzhbTPmt42O0CZOcqgzKiBknq2i9USFf3qzHbvUtCDGVpzUBThAxaDuT YoIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737450943; x=1738055743; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ev8a20hhFB0PtqA6Uck4JlPKU7F6frnJcxqcXRltDqo=; b=YnRoG3RmNx3cHzD7l3I9XiVZfEWfkh3/yx2TvoKamNOi1Dvnc1B7S11xXhFlqxZENH yEZElOA6DPEJKW8kCBdUIkWliQi26xcekIT15+pHZu3MRMmETvvUUQX94BbNyQ9VxXKx fg9AYUqHJOSAdfJV41Ew4/5vIx7PrlFiOUDRZpc21JLqmcnZl3TM9ehRmc5HbiLnDdZe p+Xyll2nP4ykEqpWOsN6bgwjmsXxk5DslYNTGmkR79VLlWEqmUn9R0aH+Jv6rDwYfDT5 EV/eXd0ZhdnfJoTti8jbm2kvLkP4sHlBsy1QDwFD5xkqeH9UhTETyJK1XaXiB6jBPXn8 VN9A== X-Forwarded-Encrypted: i=1; AJvYcCWctjwE03WTgDFE9SdmGFQlD950TLg/BjZs+Yf9PIga2f0aR7STy5kQnjckRcHmm4alJeQnOO8XHAM/5yM=@vger.kernel.org X-Gm-Message-State: AOJu0YzPbo3siBDa3JxAeXy6F+7l0Do1D9gH+2kEdxyvbi42RkTYFyvp PC//qLZJxCtf+fKWPKxuvZ9LWVklPnLoyZP+OB2fsNrZqI5h0KM/ X-Gm-Gg: ASbGncvyDwUglBX5NNc1v0qbkRNoKnhGfcKRPorEO0SSvQQ9CrV/No3VRm9BQzKNRW8 NSKUhxtEbRdR0SHpSdei3jt2EuHG/TQI83lnerXe/hBOLvo3Ub4Nx3IFvRAKrXJwfBb5AgU8Va0 A7l+Z1aVFWX349UKJPIwJbWtveXPQwrBGtVEhdk8e9I3NERGO4hDn4/7I7oZgce2xOxcikq/1Xq dIYI9g40TAO3GI+1OhTeMk2ceSlfW6h3e4gdURpL1E3KA/pV3P1/I0fOMJF14fXWeSt9ZuAILqh W4cSLw== X-Google-Smtp-Source: AGHT+IFfkS7GLMGQniMxrvsBolTsDpFXS791LkGuG3/0lFoy91fl4l7W/xWnsq64miGrYQ0pVf7qvQ== X-Received: by 2002:a05:6000:1561:b0:38c:1270:f96d with SMTP id ffacd0b85a97d-38c1270fb9fmr3605519f8f.50.1737450942684; Tue, 21 Jan 2025 01:15:42 -0800 (PST) Received: from azathoth.suse.cz ([45.250.247.107]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-38bf3221b70sm12571505f8f.26.2025.01.21.01.15.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 01:15:42 -0800 (PST) From: Brahmajit Das To: dhowells@redhat.com Cc: netfs@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] cachefiles: fix build with GCC 15 Date: Tue, 21 Jan 2025 14:45:30 +0530 Message-ID: <20250121091530.1316673-1-brahmajit.xyz@gmail.com> X-Mailer: git-send-email 2.48.1 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: 8bit While building with GCC 15 I noticed these build error fs/cachefiles/key.c:12:9: error: initializer-string for array of ‘char’ is too long [-Werror=unterminated-string-initialization] 12 | "0123456789" /* 0 - 9 */ | ^~~~~~~~~~~~ cc1: all warnings being treated as errors This due to GCC 15 having enabled -Wunterminated-string-initialization by default[0]. Separating each characters to ensure NUL termination of char array. [0]: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization Signed-off-by: Brahmajit Das --- fs/cachefiles/key.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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" -static const char cachefiles_charmap[64] = - "0123456789" /* 0 - 9 */ - "abcdefghijklmnopqrstuvwxyz" /* 10 - 35 */ - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" /* 36 - 61 */ - "_-" /* 62 - 63 */ - ; +static const char cachefiles_charmap[64] = { + '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 */ +}; static const char cachefiles_filecharmap[256] = { /* we skip space and tab and control chars */ -- 2.48.1