avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] use of GOTO statement


From: Bob Paddock
Subject: Re: [avr-gcc-list] use of GOTO statement
Date: Sun, 14 Aug 2005 05:25:42 -0400
User-agent: KMail/1.7.2

> >>> In any case, I have never used goto myself and was wondering... I
> >>> think  it only allows jumping to a label in the same function... or is
> >>> it a  UNIXism of me?
> >>
> >>  That is correct. You cant jump(GOTO) out of a function.
> >> --Royce.
> >
> > But you can longjmp().
>
> Well, I've never used it, but probably this is a macro for inline
> assembly. Also one has to take care to correct the stack(while used inside
> a function to jump out of it).

If you really want to use GOTO look at Adam Dunkels Protothreads 
"Protothreads: lightweight, stackless threads in C".

It uses the GCC extension that lets you jump to calculated labels.

-- 
                          http://www.softwaresafety.net/
 http://www.unusualresearch.com/ http://www.bpaddock.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]