lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [RFC PATCH 03/13] usb: remove the usage of the list iterator after the loop
Date
From: Linus Torvalds
> Sent: 27 February 2022 21:05
...
> And then the C standards people decided that "because our job isn't to
> describe all the architectural issues you can hit, we'll call it
> undefined, and in the process let compiler people intentionally break
> it".
>
> THAT is a problem.

I'm waiting for them to decide that memset(ptr, 0, len) of
any structure that contains a pointer is UB (because a NULL
pointer need not be the all zero bit pattern) so decide
to discard the call completely (or some such).

Non-zero NULL pointers is the only reason arithmetic on NULL
pointers isn't valid.

Or maybe that character range tests are UB because '0' to '9'
don't have to be adjacent - they are even adjacent in EBCDIC.

Some of the 'strict aliasing' bits are actually useful since
they let the compiler reorder reads and writes.
But the definition is brain-dead.
Sometimes it would be nice to have byte writes reordered,
but even using int:8 doesn't work.

I have never worked out what 'restrict' actually does,
in any places I've tried it did nothing.
Although I may have been hoping it would still help when
the function got inlined.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2022-02-28 07:16    [W:0.072 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site