Re: while (1) vs. for ( ;; )
Christian Bau wrote:[color=blue]
>
> In article <43127F62.1A60@ mindspring.com> ,
> pete <pfiland@mindsp ring.com> wrote:
>[color=green]
> > Michael B Allen wrote:[color=darkred]
> > >
> > > Should there be any preference
> > > between the following logically equivalent
> > > statements?
> > >
> > > while (1) {
> > >
> > > vs.
> > >
> > > for ( ;; ) {
> > >
> > > I suspect the answer is "no" but I'd
> > > like to know what the consensus is
> > > so that it doesn't blink through my mind anymore when I type it.[/color]
> >
> > while(1) gets a warning on my compiler.
> > for(;;) doesn't.[/color]
>
> Could you tell us which compiler? And could you check what it thinks
> about
>
> do {
> ...
> } while (0);
>[/color]
It doesn't like that one either.
--
pete
Christian Bau wrote:[color=blue]
>
> In article <43127F62.1A60@ mindspring.com> ,
> pete <pfiland@mindsp ring.com> wrote:
>[color=green]
> > Michael B Allen wrote:[color=darkred]
> > >
> > > Should there be any preference
> > > between the following logically equivalent
> > > statements?
> > >
> > > while (1) {
> > >
> > > vs.
> > >
> > > for ( ;; ) {
> > >
> > > I suspect the answer is "no" but I'd
> > > like to know what the consensus is
> > > so that it doesn't blink through my mind anymore when I type it.[/color]
> >
> > while(1) gets a warning on my compiler.
> > for(;;) doesn't.[/color]
>
> Could you tell us which compiler? And could you check what it thinks
> about
>
> do {
> ...
> } while (0);
>[/color]
It doesn't like that one either.
--
pete
Comment