Deciding whether time values should be signed or unsigned

Havoc Pennington hp at pobox.com
Mon Aug 25 11:50:58 PDT 2008


Hi,

On Mon, Aug 25, 2008 at 2:00 PM, Thiago Macieira <thiago at kde.org> wrote:
> You should use time_t, struct timeval, etc. internally, everywhere when
> dealing with the system calls. Don't try to invent your own time value.
>
> I also don't see the need to have sec/usec pairs everywhere. A struct would
> probably be better, and we have "timeval" for that. I understand the aversion
> of using any system headers in files that aren't "sysdep", so we could define
> our own structure.

Cleaning up the internal API would not be bad, I think it's a separate
patch from just fixing the warnings though. (Meaning both, ideally it
is a separate patch for purposes of git history and patch review, and
that it's OK to go ahead and fix the warnings without a larger
refactoring)

If cleaning up the internal API, I would be reluctant to use struct
timeval and time_t outside sysdeps as you say.

> I understand that the last two points don't apply to the patches you have, but
> they come as indications that signed is preferred.

Right

Havoc


More information about the dbus mailing list