Re:Let's Destroy C
by Dylan16807 on Friday January 31, 2020 @05:35AM
(#22200594)
There are a lot of undefined behaviors that only exist out of inertia and laziness. For example there's a bunch of things that should be syntax errors that are instead UB.
> Simple example: accessing an array past it's end it's undefined behaviour. If you want to remove this, you need to add bounds checking (either to raise an error or to just return 0).
What's wrong with saying "it will either return an unspecified value or trap"?
> Simple example: accessing an array past it's end it's undefined behaviour. If you want to remove this, you need to add bounds checking (either to raise an error or to just return 0).
What's wrong with saying "it will either return an unspecified value or trap"?