Re: NULL pointer dereferencing - behaviour

From: Chris Croughton (chris_at_keristor.net)
Date: 02/15/05


Date: Tue, 15 Feb 2005 20:48:58 +0000

On Tue, 15 Feb 2005 12:07:59 -0800, Andrey Tarasevich
   <andreytarasevich@hotmail.com> wrote:

> ajitho wrote:
>> http://www.comeaucomputing.com/iso/cwg_closed.html#315
>
> And? Have you tried to follow the link and read the DR#315 yourself?
> Have you ever heard about the difference between static and no-static
> members of the class?
>
> Also, try reading
>
> http://www.comeaucomputing.com/iso/cwg_active.html#232
> http://www.comeaucomputing.com/iso/cwg_active.html#453
>
> linked from DR#315.
>
> In your first example the function is not static. The behavior is
> undefined regardless of what the outcome of these still open DRs.
>
> In your second example you are trying to create a null-reference. This
> is undefined behavior. And if you read the proposed resolutions in the
> above DRs, you'll see that there's no intent whatsoever to legalize
> null-references in C++. The behavior is undefined.

I think it's some weird kind of troll. I thought originally that it was
just confused (which is not an unusual state), but just posting examples
of undefined behaviour is weird...

Chris C


Loading