GNOME Bugzilla – Bug 788384
gtypes: Fix signedness of __builtin_bswap() usage
Last modified: 2017-10-02 14:34:52 UTC
Trivial patch attached.
Created attachment 360710 [details] [review] gtypes: Fix signedness of __builtin_bswap() usage In GUINT64_TO_BE(), for example, when compiling with -Wsign-conversion, we get a warning due to an implicit cast from (gint64) to (guint64) when passing the argument to __builtin_bswap64(). According to the GCC documentation, __builtin_bswap64() takes an unsigned argument: https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html Cast the input appropriately. Signed-off-by: Philip Withnall <withnall@endlessm.com>
Sebastian, since you filed bug #531901 which originally added these builtins, would you mind taking a look at my patch please? I’m unsure if there was a specific reason you originally casted to (gint64) rather than (guint64).
Review of attachment 360710 [details] [review]: ok
Comment on attachment 360710 [details] [review] gtypes: Fix signedness of __builtin_bswap() usage Pushed as 0e888bdf52fd5f94ca6360886fe3085b646a3ec5. Sebastian, please speak up soon if you see a problem with this!