public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Brahmajit Das <brahmajit.xyz@gmail.com>
Cc: dhowells@redhat.com, david.laight.linux@gmail.com,
	linux-kernel@vger.kernel.org, netfs@lists.linux.dev
Subject: Re: [PATCH v2 1/1] cachefiles: fix build with GCC 15
Date: Mon, 10 Feb 2025 15:20:57 +0000	[thread overview]
Message-ID: <3055183.1739200857@warthog.procyon.org.uk> (raw)
In-Reply-To: <20250122090306.1524098-1-brahmajit.xyz@gmail.com>

Brahmajit Das <brahmajit.xyz@gmail.com> wrote:

> Building with GCC 15 results in the following 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]. Here we're increasing the size of cachefiles_charmap from
> 64 to 65 to ensure space for NUL. Unfortunately using
> __attribute__((nonstring)) or converting to unsigned char [] didn't help
> in this case (thanks to David Laight <david.laight.linux@gmail.com>).
> 
> Please also refer:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178, and
> https://gcc.gnu.org/pipermail/gcc-patches/2024-December/671714.html
> 
> [0]:
> https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wno-unterminated-string-initialization
> 
> Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>

Acked-by: David Howells <dhowells@redhat.com>


      reply	other threads:[~2025-02-10 15:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21  9:15 [PATCH 1/1] cachefiles: fix build with GCC 15 Brahmajit Das
2025-01-21 22:19 ` David Laight
2025-01-21 22:41   ` David Laight
2025-01-22  9:03 ` [PATCH v2 " Brahmajit Das
2025-02-10 15:20   ` David Howells [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3055183.1739200857@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=brahmajit.xyz@gmail.com \
    --cc=david.laight.linux@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netfs@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox