[Issue 16224] -cov marks the last line of do/while(0); as uncovered

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jul 1 11:12:29 PDT 2016


https://issues.dlang.org/show_bug.cgi?id=16224

--- Comment #5 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Steven Schveighoffer from comment #4)
> I don't see why while(true) is any worse.
> 
> Essentially:
> 
> while(true)
> {
> ...
> break;
> }
> 
> Is the same as the do...while(0)

Yah, switch is also fine:

switch (0)
{
default:
  ....
}

It just seems to me do/while(0) is the clearest, most obvious, and the least
bug-prone.

--


More information about the Digitalmars-d-bugs mailing list