Struct with default ctor (Was: [dmd-beta] dmd 2.064 beta take 2)

deadalnix deadalnix at gmail.com
Sun May 19 17:30:51 PDT 2013


On Monday, 20 May 2013 at 00:23:59 UTC, John Colvin wrote:
> On Sunday, 19 May 2013 at 20:45:39 UTC, Walter Bright wrote:
>> On 5/19/2013 1:03 PM, Maxim Fomin wrote:
>>> I think there is difference between catching exception and 
>>> saving
>>> data which you have typed for some period and letting harware
>>> "check" the exception for you meanwile loosing your work.
>>
>> You can catch seg faults. It's easier on Windows, but it's 
>> doable on Linux.
>
> What's the rational for not doing this by default in D? 
> Wouldn't a MemoryAccessError or similar be better than crashing 
> out with SIGSEGV ? I have no idea about the consequences of 
> this (other than tempting people to catch a segfault when they 
> shouldn't, which is pretty much always).

https://github.com/D-Programming-Language/druntime/blob/master/src/etc/linux/memoryerror.d

Still you can have weird effect when the code above throw in a 
middle of a C routine or something. As C don't know about D 
exception, it is definitively something to be aware of.


More information about the Digitalmars-d mailing list