Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!think!ima!haddock!karl From: karl@haddock Newsgroups: net.lang.c Subject: for != while Message-ID: <86900030@haddock> Date: Mon, 1-Sep-86 16:53:00 EDT Article-I.D.: haddock.86900030 Posted: Mon Sep 1 16:53:00 1986 Date-Received: Tue, 2-Sep-86 21:06:56 EDT Lines: 15 Nf-ID: #N:haddock:86900030:000:424 Nf-From: haddock!karl Sep 1 16:53:00 1986 It's well known that the equivalence between for and while breaks down if there's a "continue" statement. Here's another case I just discovered: main() { char *foo = "outer"; for (;; printf(foo),exit(0)) { char *foo = "inner"; } } This prints "outer" (vax SVR2 compiler), though the for-while equivalence might lead one to expect "inner". Karl W. Z. Heuer (ima!haddock!karl, karl@haddock.isc.com), The Walking Lint