No only somewhat different
No only somewhat different
Posted Nov 16, 2024 0:05 UTC (Sat) by SLi (subscriber, #53131)Parent article: Progress on toolchain security features
That doesn't sound like "somewhat different", but the exact opposite. The first asks the compiler to check; the second makes a promise to a compiler, allowing it to silently do rubbish if the promise doesn't hold. The first one turns (some) erroneous or undefined behavior into a warning. The second one turns correct-at-the-language-level behavior into UB.
The first one is good for diagnostics and checking. The second one is the opposite; it is good for optimization when you know something cannot happen and want the compiler to use that information as much as it can.
