[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d52dbd55e6240d5a91ebdce67fe0b7b@AcuMS.aculab.com>
Date: Wed, 30 Aug 2023 16:21:02 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Ammar Faizi' <ammarfaizi2@...weeb.org>,
Zhangjin Wu <falcon@...ylab.org>, Willy Tarreau <w@....eu>
CC: Arnd Bergmann <arnd@...db.de>,
Thomas Weißschuh <thomas@...ch.de>,
Yuan Tan <tanyuan@...ylab.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kselftest Mailing List
<linux-kselftest@...r.kernel.org>
Subject: RE: [RFC] tools/nolibc: replace duplicated -ENOSYS return with single
-ENOSYS return
From: Ammar Faizi
> Sent: 30 August 2023 15:41
>
> On 8/28/23 4:51 AM, David Laight wrote:
> > I just found a(nother) clang bug:
> > int f(void) { return "a"[2]; }
> > compiles to just a 'return'.
>
> I don't think that's a bug. It's undefined behavior due to an
> out-of-bound read. What do you expect it to return?
I was actually expecting a warning/error if it didn't just read
the byte after the end of the string.
Just silently doing nothing didn't seem right for a modern compiler.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists