[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning compiling dbusbind.c
From: |
Stefan Monnier |
Subject: |
Re: warning compiling dbusbind.c |
Date: |
Thu, 24 Jan 2008 16:25:22 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) |
> I've used make_fixnum_or_float, because BITS_PER_EMACS_INT is too small
> on 32bit machines. One possible solution could be
> dbus_uint32_t val;
> dbus_message_iter_get_basic (iter, &val);
> XD_DEBUG_MESSAGE ("%c %d", dtype, val);
> #if BITS_PER_EMACS_INT >= 32
> return make_number (val);
> #else
> return make_fixnum_or_float (val);
> #endif
Yuck. I must prefer living with the warning (which is just that:
a warning. We already have several similar ones).
> On the other hand, shouldn't it be handled in make_fixnum_or_float?
No, because make_fixnum_or_float expects an integer of type EMACS_INT.
The problem here is that you pass it an object that is slight smaller,
so soome of its internal code cann be optimized away, which is what the
compiler warns you about. Maybe casting val to EMACS_INT is enough to
silence the compiler?
I wonder if gcc would also complain in the case where
make_fixnum_or_float is an inlinable function. I'd guess not.
Stefan