January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright Wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.056.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.040.zip
>
> Thanks to the many people who contributed to this update!
Looks like this doesn't work anymore with this release (D2):
---
module Foo;
import core.runtime;
import std.c.windows.windows;
class Bar {}
extern(Windows)
int WinMain(HINSTANCE instance, HINSTANCE, LPSTR cmdLine, int cmdShow )
{
void exceptionHandler(Throwable e) {
throw e;
}
Runtime.initialize( &exceptionHandler );
auto foo = new Foo();
Runtime.terminate ( &exceptionHandler );
return 0;
}
---
When I run the program it "segfaults" with the following message (when I debug it):
Unhandled Exception: EXCEPTION_ACCESS VIOLATION(0xc000005) at object._moduleCtor2.ModuleInfo
The exception is thrown from the runtime initializer. It used to work with the previous DMD version (2.039). I think that the change of ModuleInfo from class to struct somehow affected this (just speculating).
I did a wrapper for the Windows API and now none of my programs run when I use DMD 2.040. Damn, I was excited by the new @disable attribute. :(
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | On Sat, 30 Jan 2010 10:56:28 -0500, Ary Borenszweig <ary@esperanto.org.ar> wrote:
> Walter Bright wrote:
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.056.zip
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.040.zip
>> Thanks to the many people who contributed to this update!
>
> Very nice! Each release kills a lot of bugs and adds small but very powerful features.
>
> About the interface functions, this compiles:
>
> --
> import std.stdio;
>
> interface One {
>
> final void foo() {
> writefln("One");
> }
>
> }
>
> interface Two {
>
> final void foo() {
> writefln("Two");
> }
>
> }
>
> class X : One, Two {
> }
>
> class Y : Two, One {
> }
>
> void main() {
> X x = new X();
> x.foo(); // prints "One"
> Y y = new Y();
> y.foo(); // prints "Two"
> }
> --
>
> Is this intended behaviour? Might leads to obscure bugs...
This looks like a form of function hijacking, so it should be a accepts-invalid bug.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ary Borenszweig | Ary Borenszweig wrote:
> Walter Bright wrote:
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.056.zip
>>
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.040.zip
>>
>> Thanks to the many people who contributed to this update!
>
> Very nice! Each release kills a lot of bugs and adds small but very powerful features.
>
> About the interface functions, this compiles:
>
> --
> import std.stdio;
>
> interface One {
>
> final void foo() {
> writefln("One");
> }
>
> }
>
> interface Two {
>
> final void foo() {
> writefln("Two");
> }
>
> }
>
> class X : One, Two {
> }
>
> class Y : Two, One {
> }
>
> void main() {
> X x = new X();
> x.foo(); // prints "One"
> Y y = new Y();
> y.foo(); // prints "Two"
> }
> --
>
> Is this intended behaviour? Might leads to obscure bugs...
I think this should lead to a compile-time error.
Andrei
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | bearophile wrote: > Can you tell me the purpose of the following 3 changes? > > ModuleInfo changed from class to struct Eliminate unnecessary dependencies on Object's vtbl[] > added static/final function implementations to interfaces Support NVI (Non Virtual Inheritance) idiom. |
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Yao G | Yao G wrote:
> The exception is thrown from the runtime initializer. It used to work
> with the previous DMD version (2.039). I think that the change of
> ModuleInfo from class to struct somehow affected this (just
> speculating).
Make sure you recompile everything, or you'll get crashes.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | $ dmd
Digital Mars D Compiler v2.040
Copyright (c) 1999-2009 by Digital Mars written by Walter Bright
Interestingly, copyright date is still 2009. Is this a bug or a feature?
--
Michel Fortin
michel.fortin@michelf.com
http://michelf.com/
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Michel Fortin | Michel Fortin wrote:
> $ dmd
> Digital Mars D Compiler v2.040
> Copyright (c) 1999-2009 by Digital Mars written by Walter Bright
>
> Interestingly, copyright date is still 2009. Is this a bug or a feature?
>
It takes a while for me to get all the years changed.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to grauzone | On 1/30/10 14:24, grauzone wrote:
> Jacob Carlborg wrote:
>> On 1/30/10 08:13, Walter Bright wrote:
>>>
>>> http://www.digitalmars.com/d/1.0/changelog.html
>>> http://ftp.digitalmars.com/dmd.1.056.zip
>>>
>>>
>>> http://www.digitalmars.com/d/2.0/changelog.html
>>> http://ftp.digitalmars.com/dmd.2.040.zip
>>>
>>> Thanks to the many people who contributed to this update!
>>
>> Very nice.
>> What happened to the change log for 1.055?
>> Why can't we get version(CTFE) in D1 also?
>
> You can ask this question for all other D2 features backwards compatible
> to D1 too. Why isn't __traits in D1? Why can't D1 have thread local
> variables (I'm not talking about TLS-by-default here)?
Because D1 has already got at least two new version identifier since it became feature freeze. But I see now that it's actually not a version identifier, it's a global bool.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright Wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.056.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.040.zip
>
> Thanks to the many people who contributed to this update!
Do you ever find new bugs while fixing other?
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright <newshound1@digitalmars.com> wrote: > > http://www.digitalmars.com/d/1.0/changelog.html > http://ftp.digitalmars.com/dmd.1.056.zip > > > http://www.digitalmars.com/d/2.0/changelog.html > http://ftp.digitalmars.com/dmd.2.040.zip > > Thanks to the many people who contributed to this update! D2 changelog points @disable to attribute.html#deprecated, should be attribute.html#disable -- Simen |
Copyright © 1999-2021 by the D Language Foundation