| Matthias Blume 2006-06-26, 7:04 pm |
| David Hopwood <david.nospam.hopwood@blueyonder.co.uk> writes:
> Matthias Blume wrote:
> [...]
>
> Agreed.
>
>
> I wouldn't say that was "quite easy" at all.
>
> C99 4 #2:
> # If a "shall" or "shall not" requirement that appears outside of a constraint
> # is violated, the behavior is undefined. Undefined behavior is otherwise
> # indicated in this International Standard by the words "undefined behavior"
> # *or by the omission of any explicit definition of behavior*. [...]
>
> In other words, to fix C to be a safe language (compatible with Standard C89
> or C99), you first have to resolve all the ambiguities in the standard where
> the behaviour is *implicitly* undefined. There are a lot of them.
Yes, if you want to make the transition system completely explict, it
won't be easy. I was thinking of a catch-all rule that says:
transition to "undefined" unless specified otherwise. (Note that I am
not actually advocating this approach to making a language "safe".
For practical purposes, C is unsafe. (And so is C++.))
|