Deciding whether time values should be signed or unsigned

Peter McCurdy petermccurdy at alumni.uwaterloo.ca
Mon Aug 25 10:42:40 PDT 2008


I recently filed bug 17289 [0], but it looks like this will need a bit
of discussion.

As background, I've gotten it into my head to fix all the compiler
warnings in DBus.  The warnings seem to be increasing over time, since
there's so many that need to be ignored, and at least some of them
seem to be complaining about real bugs (e.g. my recently-filed bug
17279), so it seems there is actual value to be had in fixing them.
Of the bulk of the warnings, there's one main issue, mismatched
signedness in pointers, which in turn has two root causes, signed vs.
unsigned time values and signed vs. unsigned char*s.  For starters,
I've just tackled the time values.

I made two versions of the patch, one to convert all time values to
use unsigned long, and one to convert them to signed long.  The pros
and cons of each are laid out in the bug.  The main questions up for
discussion are:

Question 1: Which version should be applied?  The signed version is
simpler and only affects one file, so it'd be my choice, but I'm not
hung up on it.

Question 2: In the bug, Havoc mentioned that my patch may conflict
with Scott James Remnant's "fix timeouts" patches.  Where can I find
these to see how bad the conflicts are and fix up my patch?

Note that the patches were made against the released 1.2.3 tarball.
I'll try to make future versions against git.

Thanks.

Peter.

[0]: http://bugs.freedesktop.org/show_bug.cgi?id=17289


More information about the dbus mailing list