dereferencing null

Daniel Murphy yebblies at nospamgmail.com
Fri Mar 2 20:13:59 PST 2012


"Peter Alexander" <peter.alexander.au at gmail.com> wrote in message 
news:jxloisomieykanavmmlj at forum.dlang.org...
> On Friday, 2 March 2012 at 10:01:32 UTC, Daniel Murphy wrote:
>> "Peter Alexander" <peter.alexander.au at gmail.com> wrote in message
>> news:vicaibqyaerogseqsjbe at forum.dlang.org...
>>>>
>>>> It's defined. The operating system protects you. You get a segfault on 
>>>> *nix and
>>>> an access violation on Windows.
>>>
>>> False.
>>>
>>> [snip]
>>>
>>> You only get an error if there is a memory access involved (vtable, 
>>> member data etc.)
>>>
>>
>> It _is_ defined, you get an access violation whenever there's a 
>> dereference.
>> Yes, you can call some types of member functions without any 
>> dereferences,
>> but this is alse well defined and sometimes quite useful.
>
> Ok, if it is defined, then please tell me what the defined behaviour of my 
> code snippet is.

Assertion failure in debug mode, prints the message in release mode. (I 
think) 




More information about the Digitalmars-d mailing list