On Wed, Apr 27, 2011 at 8:24 PM, Malcolm Cohen <[log in to unmask]> wrote:
> Neil Carlson replied:
>>
>> Right. But for the association to persist the actual must either be a
>> pointer or have the target attribute as you noted, however this isn't
>> required and so this interface is easily misused and the compiler isn't
>> going to catch it.
>
> NAG has an option to catch this (as well as other dangling pointer errors)
> at runtime. That is not as good as enforcing it at compile time (which the
> standard doesn't support), but it is better than nothing.
:-) Yes, and it works extremely well! No other (x86) compiler I've used
is able to catch this type of dangling pointer.
-Neil
|