Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!boulder!hao!husc6!cca!mirror!datacube!ftw From: ftw@datacube.UUCP Newsgroups: comp.lang.c Subject: Re: Public domain LINT? Message-ID: <102600020@datacube> Date: Mon, 16-Nov-87 10:09:00 EST Article-I.D.: datacube.102600020 Posted: Mon Nov 16 10:09:00 1987 Date-Received: Thu, 19-Nov-87 06:01:56 EST References: <189@dalcsug.UUCP> Lines: 27 Nf-ID: #R:dalcsug.UUCP:-18900:datacube:102600020:000:913 Nf-From: datacube.UUCP!ftw Nov 16 10:09:00 1987 gardner@prls.UUCP writes: > Is there any danger of stack overflow with the following construct: > for(;;) { > int k; > etc. etc. > } > (assume the loop eventually exits, of course). > In other words, is k allocated only once at the beginning of the > procedure containing this construct, or is it allocated each time > the {} block is entered? Is the answer implementation dependent? > Robert Gardner Space for "k" is alloctaed when the block under the "for" loop is entered, and de-allocated on the way out, rather than being re-allocated for each iteration of your loop. Think of that "for" loop calling a function with an auto ("k") declared in the clled function... Farrell T. Woods Datacube Inc. Systems / Software Group 4 Dearborn Rd. Peabody, Ma 01960 VOICE: 617-535-6644; FAX: (617) 535-5643; TWX: (710) 347-0125 INTERNET: ftw@datacube.COM UUCP: {rutgers, ihnp4, mirror}!datacube!ftw