[Patch] Fixing signed vs. unsigned char* warnings

Peter McCurdy petermccurdy at alumni.uwaterloo.ca
Thu Sep 4 11:11:59 PDT 2008


On Tue, Sep 2, 2008 at 3:54 PM, Thiago Macieira <thiago at kde.org> wrote:
> Peter McCurdy wrote:
>>Ah, I didn't realize DBus supported such platforms.
>
> Lots of embedded devices are using D-Bus, starting with the Nokia N-series
> tablets. And if you stay on the mailing list long enough, you're going to
> see someone posting a question about failing to cross-compile to ARM.

Right, I guess I just didn't put two and two together, w.r.t. D-Bus
supporting those platforms, and those platforms defaulting to unsigned
chars.

On that note, I noticed that the Autoconf macros that create the
dbus_int32_t typedef and friends are only based off of sizeof(char).
The C standard defines sizeof(char) == 1 in all cases, but CHAR_BITS
isn't defined to be always 8.  Is this worth worrying about, or is it
safe to ignore platforms that are bizarre enough to have
larger-than-8-bit bytes?

>>I don't have access to an ARM system or anything esoteric, but I did
>>rebuild with -funsigned-char, and "make check" still passes fine.
>>This makes sense, as I none of the code I changed now assumes that
>>chars are signed, so it's effectively running in exactly the same way
>>as it used to.
>
> Good, thanks.

Since nobody recoiled in horror at the patches, I filed bug 17433 to
track them properly.  If there are any remaining problems with them,
I'd love to hear about them so I can fix things up; otherwise, it'd be
nice to see them (and the time_t fixes in bug 17289) applied.

Peter.


More information about the dbus mailing list