[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] use of struct timeval in sys_jiffies, UNIX port
From: |
Kieran Mansley |
Subject: |
Re: [lwip-users] use of struct timeval in sys_jiffies, UNIX port |
Date: |
Thu, 19 Jun 2008 15:59:11 +0100 |
On Thu, 2008-06-19 at 16:37 +0200, address@hidden wrote:
> My compiler complained about tv.tv_sec being used before it was
> initialized, and upon inspection I must say I don't really understand
> what is happening.
>
> Depending on the compiler, isn't the value of tv_sec at best
> initialized to zero, otherwise unpredictable? And the result from
> gettimeofday is not used for anything?
>
> From sys_arch.c, UNIX port, latest version in CVS.
>
> unsigned long
> sys_jiffies(void)
> {
> struct timeval tv;
> unsigned long sec = tv.tv_sec;
> long usec = tv.tv_usec;
>
> gettimeofday(&tv,NULL);
I agree that this looks wrong. Should be a straightforward thing to fix
though. Could you file a bug?
Thanks
Kieran