This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Fix in clock.cxx
Gary Thomas <gary@mlbassoc.com> writes:
> On Mon, 2003-09-22 at 10:24, Christoph Csebits wrote:
> > On Mon, Sep 22, 2003 at 10:05:59AM -0600, Gary Thomas wrote:
> > > On Mon, 2003-09-22 at 09:47, Christoph Csebits wrote:
> > > > hello,
> > > >
> > > > compiling with powerpc-eabi-gcc (GCC) 3.2.2
> > > > we get an error message in kernel/current/src/common/clock.cxx:404
> > > > something like:
> > > >
> > > > label must be followed by statement
> > > >
> > > > the following patch is a possible solution.
> > > > (including optimizing out the #else branch)
> > >
> > > Does it work to just add an empty statement after the label?
> > > For example:
> > >
> > > add_alarm_unlock_return: ;
> >
> > yes, surely
> >
> > but where is the benefit of doing a "goto" to the
> > end of a function over using a simple return?
>
> In this case, probably little. That said, I'd be leery of making such
> a change (as you originally suggested), since I'm sure that Nick had
> good reasons for writing it the way he originally did.
Actually, this all looks like the result of later editing. There used
to be a scheduler unlock at the end of the function. I removed that a
while ago and didn't notice that the goto and label were consequently
made redundant.
Christoph's patch looks like a good way of tidying up the code. I'll
apply it tomorrow.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss