goto???

Martin Knappe kohaerenzstifter at posteo.de
Fri Jul 17 17:58:00 EDT 2015


My first solution was the answer to the question how to write that 
function without the use of goto.
I did that in less than 10 minutes and it's absolutely flawless, so yes 
it's VERY EASY.

I posted the second solution only to show how I personally would prefer 
to write that function, in a way that actually DOES use gotos, too.
My third solution was just a minor correction to this second solution 
(just one statement added), and had nothing to do with the first 
solution and the original question, of how to avoid gotos at all.

Try to

Read, Concentrate and Think ...

If you don't understand what we're talking about, please be quiet.

Yes it's VERY EASY to rewrite that function without using gotos (see my 
first post). It is and remains correct.


Am 17.07.2015 23:06 schrieb Valdis.Kletnieks at vt.edu:
> On Fri, 17 Jul 2015 10:48:53 +0200, Martin Knappe said:
>> Very easy:
> 
> On Fri, 17 Jul 2015 11:40:00 +0200, Martin Knappe said:
>> Like so:
> 
> On Fri, 17 Jul 2015 11:44:34 +0200, Martin Knappe said:
>> Sorry, have to correct my solution. You need to add "cleanupState = 0"
>> just before the "finish", like so:
> 
> I think the fact we've seen 3 version inside an hour shows that it's
> not as "Very easy" as originally asserted.



More information about the Kernelnewbies mailing list