From: Al Viro <viro@zeniv.linux.org.uk>
To: Brahmajit <brahmajit.xyz@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
Christian Brauner <brauner@kernel.org>
Subject: Re: Build failure with GCC 15 due to -Werror=unterminated-string-initialization
Date: Wed, 2 Oct 2024 22:54:13 +0100 [thread overview]
Message-ID: <20241002215413.GH4017910@ZenIV> (raw)
In-Reply-To: <20241002214656.GG4017910@ZenIV>
On Wed, Oct 02, 2024 at 10:46:56PM +0100, Al Viro wrote:
> Huh? That makes no sense whatsoever - you get a single-element
> array of 3-element arrays of pointers to char.
>
> What you have written is equivalent to
> static char *s1 = ".\0\0";
> static char *s2 = "..\0";
> static char *match_root[1][3] = {[0][0] = s1, [0][1] = s2, [0][2] = NULL};
>
> and match_root[0] is *NOT* a pointer to char anymore.
>
> Just lose the last \0 in each of those string literals...
... and looking at the actual code using that, just lose the entire
array -
if (memcmp(dir_entry[0].de_fname, ".", 2) ||
memcmp(dir_entry[1].de_fname, "..", 3))
error = 1;
and be done with that.
next prev parent reply other threads:[~2024-10-02 21:54 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 21:16 Build failure with GCC 15 due to -Werror=unterminated-string-initialization Brahmajit
2024-10-02 21:46 ` Al Viro
2024-10-02 21:54 ` Al Viro [this message]
2024-10-03 6:52 ` Brahmajit
2024-10-04 9:49 ` [PATCH 1/1] fs/qnx6: Fix building with GCC 15 Brahmajit Das
2024-10-04 18:44 ` Al Viro
2024-10-04 19:51 ` Brahmajit
2024-10-04 19:51 ` [PATCH v2 " Brahmajit Das
2024-11-15 5:03 ` Al Viro
2024-12-02 4:29 ` Al Viro
2024-12-03 9:41 ` Christian Brauner
2024-10-06 19:38 ` [PATCH " David Laight
2024-10-06 20:00 ` Al Viro
2024-10-06 23:05 ` Brahmajit
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=20241002215413.GH4017910@ZenIV \
--to=viro@zeniv.linux.org.uk \
--cc=brahmajit.xyz@gmail.com \
--cc=brauner@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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