Program logic bugs vs input/environmental errors

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 7 14:12:51 PDT 2014


On 10/07/2014 10:09 PM, Walter Bright wrote:
> On 10/7/2014 12:44 PM, Timon Gehr wrote:
>> On 10/07/2014 09:26 PM, Walter Bright wrote:
>>> On 10/7/2014 6:56 AM, Timon Gehr wrote:
>>>> On 10/06/2014 01:01 AM, Walter Bright wrote:
>>>>> Relying on program state after entering an unknown state is
>>>>> undefined by
>>>>> definition.
>>>>
>>>> What definition?
>>>
>>> How can one define the behavior of an unknown state?
>>>
>>
>> Well, how do you define the behaviour of a program that will be fed an
>> unknown
>> input? That way.
>>
>> I don't really understand what this question is trying to get at. Just
>> define
>> the language semantics appropriately.
>>
>> Your reasoning usually goes like
>>
>> a certain kind of event you assume to be bad -> bug -> unknown state ->
>> undefined behaviour.
>
>
> What defined behavior would you suggest would be possible after an
> overflow bug is detected?

At the language level, there are many possibilities. Just look at what 
type safe languages do. It is not true that this must lead to UB by a 
"definition" commonly agreed upon by participants in this thread.


More information about the Digitalmars-d mailing list