Hi!

12-Сен-2004 18:42 [EMAIL PROTECTED] (Luchezar Georgiev) wrote to
[EMAIL PROTECTED]:

>>>  unsigned char check_handle_break(struct dhdr FAR **pdev)
>>>  {
>>> -  unsigned char c;
>>> +  unsigned char c = 0;
>>>    if (ctrl_break_pressed() ||
>>>                           (c = (unsigned char)ndread(&syscon)) == CTL_C
>>> ||
>>>        *pdev != syscon && (c = (unsigned char)ndread(pdev))    == CTL_C)
>>>    {
>>>      handle(break(pdev, -1);
>>>    }
>>>    return c;
>>>  }
>> Wrong. If no Ctrl-break (ctrl_break_pressed() returns false), then
>> called second part of condition (c = ndread()). So, my code _is_
>> correct, and this extra assignemnt is useless code spending.
LG> *You* are wrong. If "ctrl_break_pressed()" returns true, "c" (and
LG> therefore the function return value) would be *undefined* without my patch!

     If ctrl_break_pressed() returns true, then handle_break() is called,
and it never returns! Note: _I_ place "return" after "if()" with call to
handle_break() only because BC doesn't support "aborts" pragma, and I wish
to eliminate warnings.

>> Unfortunately, newer standards prohibit to assign nonterminated strings
>> to arrays (ie. 5-character string "VDISK" _plus_ trerminating zero not
>> fit into 5-bytes array, so newer compilers should compain).
LG> Surprisingly, even OpenWatcom 1.3 (so new that it's not even announced!)
LG> doesn't complain! ;-)

     By "new" I mean not "latest", but "supporting latest standards". OW
supports not all latest introductions in standards. For example, WPP (was)
not support "int main()" without "return".




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to