[cfe-dev] Undiagnosed "reference to stack memory [...] returned"

Ted Kremenek kremenek at apple.com
Wed Sep 15 14:25:48 PDT 2010


On Sep 15, 2010, at 1:13 PM, Eli Friedman wrote:

> On Wed, Sep 15, 2010 at 12:58 PM, Matthieu Monrocq
> <matthieu.monrocq at gmail.com> wrote:
>> Therefore it seems that the proper thing to do would be to diagnose the
>> issue (in both get_reference_no_warning cases) and let the developer fix
>> them. I surmise it should be possible to detect them (since VC++ already
>> detects the first case), but then, as I said, I am very naive about
>> compilers yet.
>> 
>> I hope to look at this further during the week-end, guess it would be as
>> good a way as any to try and understand how Clang work
> 
> Yes, we should be able to diagnose both cases... the relevant code is
> Sema::CheckReturnStackAddr in SemaChecking.cpp.
> 
> -Eli

I'll fix this.  It will be good for me (after being confused about this one).



More information about the cfe-dev mailing list