Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!sdd.hp.com!zaphod.mps.ohio-state.edu!ub!uhura.cc.rochester.edu!rochester!pt.cs.cmu.edu!o.gp.cs.cmu.edu!andrew.cmu.edu!jh4o+ From: jh4o+@andrew.cmu.edu (Jeffrey T. Hutzelman) Newsgroups: comp.lang.c Subject: Re: #define forever for(;;) Message-ID: Date: 25 Oct 90 16:39:02 GMT References: <250@motto.UUCP> Organization: Carnegie Mellon, Pittsburgh, PA Lines: 30 In-Reply-To: <250@motto.UUCP> andrew@motto.UUCP (Andrew Walduck) writes: >>#define ever (;;) >>#define nothing ; >> >>Then you get >> >>for ever >> { >> ... >> } > Is this really defined to loop forever?? Does ANSI guarantee this > behaviour? > Just to be safe I'd define ever like: > #define ever(;1;) > Just to make the behaviour predictable. A couple things. As has been pointed out to me (and I kind of knew already), the #define ever is not actually very useful. However, I use for(;;) all the time in place of while(1) with no problem. And yes, I believe that it is defined that the loop will loop forever if the condition is not given. Some one back me up on this, or tell me I;m wrong. ----------------- Jeffrey Hutzelman America Online: JeffreyH11 Internet/BITNET:jh4o+@andrew.cmu.edu, jhutz@drycas.club.cc.cmu.edu, jh4o@cmuccvma >> Apple // Forever!!! <<