This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Is there any way to give a warning when a nested function use its parent function's local variable value.
- From: Andrew Haley <aph at redhat dot com>
- To: Mark Farnell <mark dot farnell at gmail dot com>, "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 25 Nov 2014 21:19:23 +0000
- Subject: Re: Is there any way to give a warning when a nested function use its parent function's local variable value.
- Authentication-results: sourceware.org; auth=none
- References: <CAHQM7829YBL1OJyWeWFZ=sc3LsVeq-jZi=rqM46O+Zs9aW30Ng at mail dot gmail dot com> <CADD2D=4EGXowU6tH_s3wA5aeuWXpNVnrUwtH7BsXPLgPR0QHyg at mail dot gmail dot com>
On 11/23/2014 08:00 AM, Mark Farnell wrote:
> I don't think you need a warning in this particular case, perhaps a
> better way would be for the compiler to enforce a rule that forbids
> access of function pointers of inner functions that referencing local
> variables of its parent function.
Why would anyone want to forbid this?
cs.stanford.edu/~blynn/files/lexic.pdf
Andrew.