[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241002215413.GH4017910@ZenIV>
Date: Wed, 2 Oct 2024 22:54:13 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Brahmajit <brahmajit.xyz@...il.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Christian Brauner <brauner@...nel.org>
Subject: Re: Build failure with GCC 15 due to
-Werror=unterminated-string-initialization
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.
Powered by blists - more mailing lists