Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site wjvax.wjvax.UUCP Path: utzoo!linus!decvax!decwrl!sun!saber!qubix!wjvax!brett From: brett@wjvax.UUCP (Brett Galloway) Newsgroups: net.lang.c,net.unix-wizards Subject: Re: Stack Frames Message-ID: <655@wjvax.wjvax.UUCP> Date: Fri, 21-Feb-86 12:57:49 EST Article-I.D.: wjvax.655 Posted: Fri Feb 21 12:57:49 1986 Date-Received: Mon, 24-Feb-86 08:35:31 EST References: <1084@brl-smoke.ARPA> Reply-To: brett@wjvax.UUCP (Brett Galloway) Followup-To: net.unix-wizards Organization: Watkins-Johnson Co., San Jose, Calif. Lines: 25 Xref: linus net.lang.c:7407 net.unix-wizards:14090 This posting may be slightly inappropriate in net.lang.c, but I am interested in the matter of how variables get declared in routine subblocks (i.e. within {} within a routine; for example: routine() { int a; { int b; } } I would assume that they are declared in routine()'s stack frame, and that the only effect of declaring them in a subblock is to restrict their scope to that subblock. HOWEVER, in the Mt Xinu port of BSD 4.2 (for a VAX 750), dbx does not seem to treat them this way; once dbx has moved into a subblock in which variables are declared, any variables higher up in the stack are marked as "not active". This behaviour of dbx appears to be wrong. My question is whether this behaviour is simply a shortcoming of dbx's implementation of subblock scoping, or whether it reflects some peculiarity in the way variables declared in subblocks are treated by the c compiler. My apologies if this question is obvious or inappropriate. Please send me mail if the answer is not of general interest. ------------- Brett Galloway {pesnta,twg,ios,qubix,turtlevax,tymix,vecpyr,certes,isi}!wjvax!brett