RE: [RFC] tools/nolibc: replace duplicated -ENOSYS return with single -ENOSYS return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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)




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux