D2 is really that stable as it is claimed to be?

Mike Wey mike-wey at example.com
Sun Sep 22 10:16:13 PDT 2013


On 09/22/2013 12:36 AM, Walter Bright wrote:
> On 9/21/2013 3:11 PM, Maxim Fomin wrote:
>> On Saturday, 21 September 2013 at 22:06:07 UTC, Walter Bright wrote:
>>> On 9/21/2013 2:40 PM, Maxim Fomin wrote:
>>>> Thanks, that is clear. Unfortunately, I cannot say that the
>>>> explanation improves
>>>> my attidute to the language - dmd still breaks too often code and some
>>>> significant features (like AAs, scope, shared) are at risk to be
>>>> seriously
>>>> changed which is a serious problem to the user.
>>>
>>> I'm curious - was there a logic bug in your code with the overflow,
>>> or had
>>> that been the intended behavior?
>>
>> This was bug in gtkd sources when I tried to compile its most recent
>> version
>> (tried even from github) with git-head dmd. I think it is a problem of
>> gtkd
>> developers rather than dmd.
>
> Ok, so it found a latent bug in the source code - I don't think that's a
> good example of dmd being unstable - it was a good change.

I've reduced the code causing the error to this:
```
public enum GTokenType
{
	NONE,
}

public enum GtkRcTokenType
{
	INVALID = GTokenType.NONE,
	INCLUDE,
}
```

In this case the value of INVALID + 1 isn't large enough the overflow an 
int.

In the actual code:
https://github.com/gtkd-developers/GtkD/blob/master/src/gtkc/glibtypes.d#L1310
Setting NONE to a value lower than 87 makes it so the code compiles 
without error, which only makes things weirder.

-- 
Mike Wey


More information about the Digitalmars-d mailing list