[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWpHSsAB3WosyCVgS6+t4pU35Xfj3tjmdCDoyS2QkS7iw@mail.gmail.com>
Date: Tue, 17 Jan 2023 21:05:58 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>
Cc: linux-kernel@...r.kernel.org, amd-gfx@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org, linux-media@...r.kernel.org,
linux-wireless@...r.kernel.org, linux-mips@...r.kernel.org,
linux-sh@...r.kernel.org, linux-f2fs-devel@...ts.sourceforge.net,
linuxppc-dev@...ts.ozlabs.org, kasan-dev@...glegroups.com,
linux-xtensa@...ux-xtensa.org,
Michael Karcher <kernel@...rcher.dialup.fu-berlin.de>,
Arnd Bergmann <arnd@...db.de>
Subject: Re: Calculating array sizes in C - was: Re: Build regressions/improvements
in v6.2-rc1
Hi Adrian,
On Tue, Jan 17, 2023 at 6:06 PM John Paul Adrian Glaubitz
<glaubitz@...sik.fu-berlin.de> wrote:
> On 1/17/23 18:01, Geert Uytterhoeven wrote:
> > The issue is that some of the parameters are not arrays, but
> > NULL. E.g.:
> >
> > arch/sh/kernel/cpu/sh2/setup-sh7619.c:static
> > DECLARE_INTC_DESC(intc_desc, "sh7619", vectors, NULL,
> > arch/sh/kernel/cpu/sh2/setup-sh7619.c- NULL,
> > prio_registers, NULL);
>
> Isn't this supposed to be caught by this check:
>
> a, __same_type(a, NULL)
>
> ?
Yeah, but gcc thinks it is smarter than us...
Probably it drops the test, assuming UB cannot happen.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists