How does "Modern" C compare safety-wise to Rust or Zig?
replies(4):
D does not decay arrays, so D has array bounds checking.
Note that array overflow bugs are consistently the #1 problem with shipped C code, by a wide margin.
This isn’t strictly true, a C implementation is allowed to associate memory-range (or more generally, pointer provenance) metadata with a pointer.
The DeathStation 9000 features a conforming C implementation which is known to catch all array bounds violations. ;)
The holy grail is runtime access to the length, which means an array would have to be backed by something more elaborate.