Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site kovacs.UUCP Path: utzoo!linus!vaxine!wjh12!genrad!decvax!ittvax!dcdwest!sdcsvax!sdcrdcf!randvax!kovacs!jim From: jim@kovacs.UUCP Newsgroups: net.lang.c,net.bugs.4bsd Subject: Block Structure Declarations Message-ID: <173@kovacs.UUCP> Date: Thu, 24-May-84 11:59:31 EDT Article-I.D.: kovacs.173 Posted: Thu May 24 11:59:31 1984 Date-Received: Mon, 28-May-84 05:54:08 EDT Organization: Robt Abel & Assoc, Hollywood Lines: 28 Xref: 567 223 > According to K&R in "The C Programming Language" Sect 4.8, page 81: "Declarations of variables (including initializations) may follow the left brace that introduces *ANY* compound statement, not just the one that begins a function. Variables declared in this way supersede any identically named variables in outer blocks..." Three examples are given. One example not given is: f(x) double x; { short x; ... } Within function "f", occurences of "x" refer to the internal "short" variable. The compiler will not say a word about this. Lint says "argument x unused in function f". Since I cannot think of a single case where one would intentionally do this, I think the compiler should warn that argument x is being redeclared. -Jim Keating- R. Abel & Assoc. Hollywood, CA 90038 (213) 462 8100