Fixing C's Biggest Mistake
Timon Gehr
timon.gehr at gmx.ch
Thu Dec 29 20:46:47 UTC 2022
On 12/29/22 21:38, Walter Bright wrote:
> On 12/28/2022 1:33 AM, Timon Gehr wrote:
>> On 12/27/22 23:53, Walter Bright wrote:
>>> This is not a failure, it's a positive feature.
>>
>> To some extent. Aspects of this have been lovingly nicknamed the
>> "billion dollar mistake".
>
> I don't agree with that assessment at all. Having a seg fault when your
> program enters an unanticipated, invalid state
The bad thing is allowing programs to enter unanticipated, invalid
states in the first place...
> is a *good* thing. The
> *actual* billion dollar mistake(s) in C are:
>
> 1. uninitialized data leading to undefined behavior
>
> 2. no way to do array buffer overflow detection
>
> because those lead to malware and other silent disasters.
> ...
Not all disasters are silent. Maybe you are biased because you only
write batch programs that are intended to implement a very precise spec.
More information about the Digitalmars-d
mailing list