2014-02-24 16:38:30

by Donald Carr

[permalink] [raw]
Subject: [PATCH] Bluetooth: Fix bluetooth.h for inclusion in clang projects

>From b12351dacb8e7fc44668ab4011db1d1b2b83e883 Mon Sep 17 00:00:00 2001
From: Donald Carr <[email protected]>
Date: Mon, 24 Feb 2014 08:34:46 -0800
Subject: [PATCH] Move from typeof gcc intrinsic to __typeof__

Change-Id: Ic3aa6ec1446876bfabdcc5e120ec327e177ffc74
---
lib/bluetooth.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 61c1f9a..bc9b35e 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -158,16 +158,16 @@ enum {
#define bt_get_unaligned(ptr) \
({ \
struct __attribute__((packed)) { \
- typeof(*(ptr)) __v; \
- } *__p = (typeof(__p)) (ptr); \
+ __typeof__(*(ptr)) __v; \
+ } *__p = (__typeof__(__p)) (ptr); \
__p->__v; \
})

#define bt_put_unaligned(val, ptr) \
do { \
struct __attribute__((packed)) { \
- typeof(*(ptr)) __v; \
- } *__p = (typeof(__p)) (ptr); \
+ __typeof__(*(ptr)) __v; \
+ } *__p = (__typeof__(__p)) (ptr); \
__p->__v = (val); \
} while(0)

--
1.9.0

--
-------------------------------
?v? Donald Carr
/(_)\ Vaguely Professional Penguin lover
^ ^

Cave canem, te necet lingendo


2014-02-24 20:51:40

by Anderson Lizardo

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: Fix bluetooth.h for inclusion in clang projects

Hi Donald,

On Mon, Feb 24, 2014 at 12:38 PM, Donald Carr <[email protected]> wrote:
> From b12351dacb8e7fc44668ab4011db1d1b2b83e883 Mon Sep 17 00:00:00 2001
> From: Donald Carr <[email protected]>
> Date: Mon, 24 Feb 2014 08:34:46 -0800
> Subject: [PATCH] Move from typeof gcc intrinsic to __typeof__
>
> Change-Id: Ic3aa6ec1446876bfabdcc5e120ec327e177ffc74

I wonder why I'm not having any warnings when compiling BlueZ with
clang. Can you confirm which clang parameters are causing problems?

What I use is (when compiling bluez):

###
CC=clang ./bootstrap-configure
make
###

Regarding your patch, a few comments:

1) you should remove the "Change-Id" field (it is not used on BlueZ).
2) Your e-mail seems badly formatted (like as if you just copied one
email inside another). I suggest using "git send-email" for sending
properly formatted patches to the list.
3) The "Bluetooth:" subject prefix is only used for kernel patches.
For userspace patches, add a prefix which describes which part of the
code is affected (usually the subdirectory name is enough), in this
case:

lib: Move from typeof gcc intrinsic to __typeof__

4) A more verbose commit message would not hurt :)

Best Regards,
--
Anderson Lizardo
http://www.indt.org/?lang=en
INdT - Manaus - Brazil