Re: [RFC] ->d_name accesses

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

 



On Fri, 9 Feb 2024 at 11:10, Nick Desaulniers <ndesaulniers@xxxxxxxxxx> wrote:
>
> I have 100% observed llvm throw out writes to objects declared as
> const where folks tried to write via "casting away the const" (since
> that's UB) which resulted in boot failures in the Linux kernel
> affecting android devices.

*PLEASE* fix compilers that silently generate bogus code just because it's UB.

That's pure and utter garbage.

We want a compiler flag that says "don't do that idiotic sh*t". There
are very good reasons why Linux uses flags like

  -fno-strict-overflow
  -fno-strict-aliasing
  -fno-delete-null-pointer-checks

and that reason is that the ANSI C standards committee has had its
head up its arse when it comes to these areas.

Optimizations based on undefined behavior are wrong. If you have to
resort to those kinds of optimizations, your compiler is bad.

*Silently* doing so is even worse.

If the compiler decides "I will throw away this write because it's
UB", I want a warning.

Better yet, I'd like to see compiler writers admit that undefined
behavior was not a good language feature in the first place, and that
any time the standard says "that's undefined behavior", you ignore
that bogus standards language, and you turn it into "implementation
defined", possibly with a warning.

                   Linus




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux