Re: [PATCH] preserve integer value of local addresses returned from functions (PR 90737)

2019-06-05 Thread Jeff Law
On 6/3/19 3:24 PM, Martin Sebor wrote: > While testing a different -Wreturn-local-addr bug fix/enhancement > I noticed that in functions that return integers as opposed to > pointers such as: > >   intptr_t f (int i) { return (intptr_t)&i; } > > the converted address is folded to zero.  This can 

[PATCH] preserve integer value of local addresses returned from functions (PR 90737)

2019-06-03 Thread Martin Sebor
While testing a different -Wreturn-local-addr bug fix/enhancement I noticed that in functions that return integers as opposed to pointers such as: intptr_t f (int i) { return (intptr_t)&i; } the converted address is folded to zero. This can be detected by strictly conforming programs so it's