Seems like another reason to move forward with strong typing for ODP data
types?

On Wed, Jan 14, 2015 at 6:23 AM, Ola Liljedahl <[email protected]>
wrote:

> From the timer_settime man page:
>        int timer_settime(timer_t timerid, int flags,
>                          const struct itimerspec *new_value,
>                          struct itimerspec * old_value);
>
> On 14 January 2015 at 13:11, Ola Liljedahl <[email protected]>
> wrote:
> > Timerid is passed by value, not reference. Compiler cannot detect this
> problem
> > because timer_t is defined as a void ptr on Linux.
> >
> > Signed-off-by: Ola Liljedahl <[email protected]>
>

Reviewed-by: Bill Fischofer <[email protected]>


> > ---
> > (This document/code contribution attached is provided under the terms of
> > agreement LES-LTM-21309)
> > Broken code worked anyway on x86-64 and ARMv7 targets but bug was
> detected on
> > i386 target or -m32 build on x86-64 target.
> >
> >  platform/linux-generic/odp_timer.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/platform/linux-generic/odp_timer.c
> b/platform/linux-generic/odp_timer.c
> > index ef26b02..3ba32a1 100644
> > --- a/platform/linux-generic/odp_timer.c
> > +++ b/platform/linux-generic/odp_timer.c
> > @@ -659,7 +659,7 @@ static void itimer_init(odp_timer_pool *tp)
> >         ispec.it_value.tv_sec     = (time_t)sec;
> >         ispec.it_value.tv_nsec    = (long)nsec;
> >
> > -       if (timer_settime(&tp->timerid, 0, &ispec, NULL))
> > +       if (timer_settime(tp->timerid, 0, &ispec, NULL))
> >                 ODP_ABORT("timer_settime() returned error %s\n",
> >                           strerror(errno));
> >  }
> > --
> > 1.9.1
> >
>
> _______________________________________________
> lng-odp mailing list
> [email protected]
> http://lists.linaro.org/mailman/listinfo/lng-odp
>
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to