[ros-dev] [ros-diffs] [hbelusca] 58110: while (TRUE); (when something is unimplemented) ---> ASSERT(FALSE); // while (TRUE); (unless we deal with a 'noreturn' function), and in some cases, return an adequate value. Part...

Aleksey Bragin aleksey at reactos.org
Fri Jan 4 14:15:17 UTC 2013


this while (TRUE); means that "OS can't function anymore if this 
codepath is executed". It's a fatal, terminal way, so there is no power 
to save :)

On 04.01.2013 18:11, Javier Agustìn Fernàndez Arroyo wrote:
> well, IMO, "while(true)" means CPU is permanently busy, while an 
> ASSERT stops CPU from running ....
> just a matter of power saving....
>
> and i repeat, its just an opinion....
>
> On Fri, Jan 4, 2013 at 3:02 PM, Aleksey Bragin <aleksey at reactos.org 
> <mailto:aleksey at reactos.org>> wrote:
>
>     With all respect, I don't understand many of these changes.
>     Answering between the lines.
>
>     On 04.01.2013 15:47, hbelusca at svn.reactos.org
>     <mailto:hbelusca at svn.reactos.org> wrote:
>
>           NTSTATUS
>         @@ -643,7 +643,8 @@
>               /* FIXME: TODO */
>               DPRINT1("You have implemented the KD routines for
>         searching PCI debugger"
>                       "devices, but you have forgotten to implement
>         this routine\n");
>         -    while (TRUE);
>         +    UNIMPLEMENTED;
>         +    ASSERT(FALSE); // while (TRUE);
>           }
>
>     It already prints a mandatory log message that this part is
>     unimplemented. And execution is supposed to stop after printing
>     this message, because it's meaningless to continue (that's why
>     while(TRUE); was put there in the first place).
>
>             static ULONG NTAPI
>         @@ -678,7 +679,7 @@
>               {
>                   /* /PCILOCK is not yet supported */
>                   UNIMPLEMENTED;
>         -        while (TRUE);
>         +        ASSERT(FALSE); // while (TRUE);
>               }
>           #endif
>               /* Now create the correct resource list based on the
>         supported bus ranges */
>
>     It already has UNIMPLEMENTED; and now you added an ASSERT(FALSE);
>     which essentially is the same thing. And if continuation is
>     possible, then just UNIMPLEMENTED would be enough.
>
>     I'd like some general solution to this. Like,
>     UNIMPLEMENTED_FATAL() or something like that.
>
>     Any thoughts?
>
>     Regards,
>     Aleksey Bragin
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.reactos.org/pipermail/ros-dev/attachments/20130104/d0e8648f/attachment.html>


More information about the Ros-dev mailing list