2011-05-02 20:43:26

by Anderson Briglia

[permalink] [raw]
Subject: [PATCH] Remove btio.c compilation warning

From: Anderson Briglia <[email protected]>

This patch fixes a compilation warning regarding btio/btio.c
compilation.
---
btio/btio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/btio/btio.c b/btio/btio.c
index 6d71b90..8f166cc 100644
--- a/btio/btio.c
+++ b/btio/btio.c
@@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
uint8_t dev_class[3];
uint16_t handle;
socklen_t len;
- gboolean flushable;
+ gboolean flushable = TRUE;

len = sizeof(l2o);
memset(&l2o, 0, len);
--
1.7.4.1



2011-05-05 19:01:48

by Bastien Nocera

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

On Thu, 2011-05-05 at 11:05 -0300, Vinicius Costa Gomes wrote:
> Hi Luiz,
>
> On 11:05 Thu 05 May, Luiz Augusto von Dentz wrote:
>
> [snip]
>
> >
> > I don't see why it would be ubuntu specific, this seems to be some
> > kind of regression/'feature' with gcc 4.5.
>
> Yeah, I really believe this is the case. I have gcc 4.5.2 here, that
> would be the version as in Natty, and I don't encounter that problem.
>
> The only difference that I could find is that Ubuntu ships gcc with
> a .diff.gz of 1.3MB ;-)
>
> But back to the topic at hand, I agree that the patch should be applied,
> Ubuntu is used by many developers and BlueZ should be kept clean of
> warnings.

It's also a bug in the GCC 4.6 shipped by Fedora 15, fwiw.

Cheers


2011-05-05 18:51:29

by Anderson Briglia

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi all,

On Thu, May 5, 2011 at 10:30 AM, Luiz Augusto von Dentz
<[email protected]> wrote:
> Hi Vinicius,
>
> On Thu, May 5, 2011 at 5:05 PM, Vinicius Costa Gomes
> <[email protected]> wrote:
>> Hi Luiz,
>>
>> On 11:05 Thu 05 May, Luiz Augusto von Dentz wrote:
>>
>> [snip]
>>
>>>
>>> I don't see why it would be ubuntu specific, this seems to be some
>>> kind of regression/'feature' with gcc 4.5.
>>
>> Yeah, I really believe this is the case. I have gcc 4.5.2 here, that
>> would be the version as in Natty, and I don't encounter that problem.
>
> So it seems to be Ubuntu specific in some way, very annoying way.
>
>> The only difference that I could find is that Ubuntu ships gcc with
>> a .diff.gz of 1.3MB ;-)
>>
>> But back to the topic at hand, I agree that the patch should be applied,
>> Ubuntu is used by many developers and BlueZ should be kept clean of
>> warnings.
>
> Well if we don't get anywhere with the bug Elvis sent than that is the
> only think we can do, or maybe there is some new gcc flag that can
> prevent such behavior.

I'll resend the patch and you decide if it is worth to be applied or not.

Regards,

Briglia

>
>
> --
> Luiz Augusto von Dentz
> Computer Engineer
>



--
INdT - Instituto Nokia de tecnologia
+55 2126 1122
http://techblog.briglia.net

2011-05-05 14:30:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi Vinicius,

On Thu, May 5, 2011 at 5:05 PM, Vinicius Costa Gomes
<[email protected]> wrote:
> Hi Luiz,
>
> On 11:05 Thu 05 May, Luiz Augusto von Dentz wrote:
>
> [snip]
>
>>
>> I don't see why it would be ubuntu specific, this seems to be some
>> kind of regression/'feature' with gcc 4.5.
>
> Yeah, I really believe this is the case. I have gcc 4.5.2 here, that
> would be the version as in Natty, and I don't encounter that problem.

So it seems to be Ubuntu specific in some way, very annoying way.

> The only difference that I could find is that Ubuntu ships gcc with
> a .diff.gz of 1.3MB ;-)
>
> But back to the topic at hand, I agree that the patch should be applied,
> Ubuntu is used by many developers and BlueZ should be kept clean of
> warnings.

Well if we don't get anywhere with the bug Elvis sent than that is the
only think we can do, or maybe there is some new gcc flag that can
prevent such behavior.


--
Luiz Augusto von Dentz
Computer Engineer

2011-05-05 14:05:31

by Vinicius Costa Gomes

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi Luiz,

On 11:05 Thu 05 May, Luiz Augusto von Dentz wrote:

[snip]

>
> I don't see why it would be ubuntu specific, this seems to be some
> kind of regression/'feature' with gcc 4.5.

Yeah, I really believe this is the case. I have gcc 4.5.2 here, that
would be the version as in Natty, and I don't encounter that problem.

The only difference that I could find is that Ubuntu ships gcc with
a .diff.gz of 1.3MB ;-)

But back to the topic at hand, I agree that the patch should be applied,
Ubuntu is used by many developers and BlueZ should be kept clean of
warnings.

>
> --
> Luiz Augusto von Dentz
> Computer Engineer
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html


Cheers,
--
Vinicius

2011-05-05 08:05:09

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi,

On Thu, May 5, 2011 at 2:23 AM, Elvis Pf?tzenreuter <[email protected]> wrote:
> On 4 May 2011, at 20:09 , Anderson Briglia wrote:
>
>> Hi Johan,
>>
>> On Wed, May 4, 2011 at 5:39 PM, Johan Hedberg <[email protected]> wrote:
>>> Hi,
>>>
>>> On Mon, May 02, 2011, [email protected] wrote:
>>>> This patch fixes a compilation warning regarding btio/btio.c
>>>> compilation.
>>>> ---
>>>> ?btio/btio.c | ? ?2 +-
>>>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/btio/btio.c b/btio/btio.c
>>>> index 6d71b90..8f166cc 100644
>>>> --- a/btio/btio.c
>>>> +++ b/btio/btio.c
>>>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
>>>> ? ? ? uint8_t dev_class[3];
>>>> ? ? ? uint16_t handle;
>>>> ? ? ? socklen_t len;
>>>> - ? ? gboolean flushable;
>>>> + ? ? gboolean flushable = TRUE;
>>>>
>>>> ? ? ? len = sizeof(l2o);
>>>> ? ? ? memset(&l2o, 0, len);
>>>
>>> So are we going to get an updated patch for this (with the modifications
>>> that were requested)? It's quite clearly a false positive by the
>>> compiler (i.e. a compiler bug) but I still think that we should try to
>>> keep the BlueZ tree compilable with "./bootstrap-configure && make" for
>>> all major distributions.
>>
>> Elvis is going to open a bug in Ubuntu bug system regarding this false
>> positive. I believe it is worth to wait what Ubuntu developers will
>> say.

I don't see why it would be ubuntu specific, this seems to be some
kind of regression/'feature' with gcc 4.5.

--
Luiz Augusto von Dentz
Computer Engineer

2011-05-04 23:23:25

by Elvis Pfutzenreuter

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

On 4 May 2011, at 20:09 , Anderson Briglia wrote:

> Hi Johan,
>
> On Wed, May 4, 2011 at 5:39 PM, Johan Hedberg <[email protected]> wrote:
>> Hi,
>>
>> On Mon, May 02, 2011, [email protected] wrote:
>>> This patch fixes a compilation warning regarding btio/btio.c
>>> compilation.
>>> ---
>>> btio/btio.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/btio/btio.c b/btio/btio.c
>>> index 6d71b90..8f166cc 100644
>>> --- a/btio/btio.c
>>> +++ b/btio/btio.c
>>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
>>> uint8_t dev_class[3];
>>> uint16_t handle;
>>> socklen_t len;
>>> - gboolean flushable;
>>> + gboolean flushable = TRUE;
>>>
>>> len = sizeof(l2o);
>>> memset(&l2o, 0, len);
>>
>> So are we going to get an updated patch for this (with the modifications
>> that were requested)? It's quite clearly a false positive by the
>> compiler (i.e. a compiler bug) but I still think that we should try to
>> keep the BlueZ tree compilable with "./bootstrap-configure && make" for
>> all major distributions.
>
> Elvis is going to open a bug in Ubuntu bug system regarding this false
> positive. I believe it is worth to wait what Ubuntu developers will
> say.

I have reported the bug yesterday
(https://bugs.launchpad.net/ubuntu/+source/gcc-defaults/+bug/776447),
but don't hold your breath while waiting for a response, you *will* die :)

2011-05-04 23:09:38

by Anderson Briglia

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi Johan,

On Wed, May 4, 2011 at 5:39 PM, Johan Hedberg <[email protected]> wrote:
> Hi,
>
> On Mon, May 02, 2011, [email protected] wrote:
>> This patch fixes a compilation warning regarding btio/btio.c
>> compilation.
>> ---
>> ?btio/btio.c | ? ?2 +-
>> ?1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/btio/btio.c b/btio/btio.c
>> index 6d71b90..8f166cc 100644
>> --- a/btio/btio.c
>> +++ b/btio/btio.c
>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
>> ? ? ? uint8_t dev_class[3];
>> ? ? ? uint16_t handle;
>> ? ? ? socklen_t len;
>> - ? ? gboolean flushable;
>> + ? ? gboolean flushable = TRUE;
>>
>> ? ? ? len = sizeof(l2o);
>> ? ? ? memset(&l2o, 0, len);
>
> So are we going to get an updated patch for this (with the modifications
> that were requested)? It's quite clearly a false positive by the
> compiler (i.e. a compiler bug) but I still think that we should try to
> keep the BlueZ tree compilable with "./bootstrap-configure && make" for
> all major distributions.

Elvis is going to open a bug in Ubuntu bug system regarding this false
positive. I believe it is worth to wait what Ubuntu developers will
say.

Briglia
>
> Johan
>



--
INdT - Instituto Nokia de tecnologia
+55 2126 1122
http://techblog.briglia.net

2011-05-04 21:39:36

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi,

On Mon, May 02, 2011, [email protected] wrote:
> This patch fixes a compilation warning regarding btio/btio.c
> compilation.
> ---
> btio/btio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/btio/btio.c b/btio/btio.c
> index 6d71b90..8f166cc 100644
> --- a/btio/btio.c
> +++ b/btio/btio.c
> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
> uint8_t dev_class[3];
> uint16_t handle;
> socklen_t len;
> - gboolean flushable;
> + gboolean flushable = TRUE;
>
> len = sizeof(l2o);
> memset(&l2o, 0, len);

So are we going to get an updated patch for this (with the modifications
that were requested)? It's quite clearly a false positive by the
compiler (i.e. a compiler bug) but I still think that we should try to
keep the BlueZ tree compilable with "./bootstrap-configure && make" for
all major distributions.

Johan

2011-05-02 21:47:28

by Gustavo Padovan

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi Briglia,

* Anderson Briglia <[email protected]> [2011-05-02 18:33:11 -0300]:

> Hi all,
>
> On Mon, May 2, 2011 at 6:23 PM, Elvis Pf?tzenreuter <[email protected]> wrote:
> > On May 2, 2011, at 6:15 PM, Johan Hedberg wrote:
> >
> >> Hi Briglia,
> >>
> >> On Mon, May 02, 2011, [email protected] wrote:
> >>> This patch fixes a compilation warning regarding btio/btio.c
> >>> compilation.
> >>> ---
> >>> btio/btio.c | ? ?2 +-
> >>> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>>
> >>> diff --git a/btio/btio.c b/btio/btio.c
> >>> index 6d71b90..8f166cc 100644
> >>> --- a/btio/btio.c
> >>> +++ b/btio/btio.c
> >>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
> >>> ? ? ?uint8_t dev_class[3];
> >>> ? ? ?uint16_t handle;
> >>> ? ? ?socklen_t len;
> >>> - ? ?gboolean flushable;
> >>> + ? ?gboolean flushable = TRUE;
> >>>
> >>> ? ? ?len = sizeof(l2o);
> >>> ? ? ?memset(&l2o, 0, len);
> >>
> >> I don't get the warning with my compiler, so in addition to the already
> >> requested compiler logs please also mention the compiler version. Also,
> >> the value should default to FALSE and not TRUE.
>
> >
> > It looks like a false alarm from gcc 4.5.2 (Ubuntu Natty), or at least I feel
> > like it (got it here, too). If you agree, a bug ticket could be submitted to them.
>
> It makes sense. This "fake" warning appears after I upgraded to Ubuntu
> Natty. Anyway, you guys could make a quick test adding
> --enable-maintainer-mode flag to configure.

We always have maintainer mode enabled and I can't see anything wrong here. It's
probably your ubuntu.

--
Gustavo F. Padovan
http://profusion.mobi

2011-05-02 21:33:11

by Anderson Briglia

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi all,

On Mon, May 2, 2011 at 6:23 PM, Elvis Pf?tzenreuter <[email protected]> wrote:
> On May 2, 2011, at 6:15 PM, Johan Hedberg wrote:
>
>> Hi Briglia,
>>
>> On Mon, May 02, 2011, [email protected] wrote:
>>> This patch fixes a compilation warning regarding btio/btio.c
>>> compilation.
>>> ---
>>> btio/btio.c | ? ?2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/btio/btio.c b/btio/btio.c
>>> index 6d71b90..8f166cc 100644
>>> --- a/btio/btio.c
>>> +++ b/btio/btio.c
>>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
>>> ? ? ?uint8_t dev_class[3];
>>> ? ? ?uint16_t handle;
>>> ? ? ?socklen_t len;
>>> - ? ?gboolean flushable;
>>> + ? ?gboolean flushable = TRUE;
>>>
>>> ? ? ?len = sizeof(l2o);
>>> ? ? ?memset(&l2o, 0, len);
>>
>> I don't get the warning with my compiler, so in addition to the already
>> requested compiler logs please also mention the compiler version. Also,
>> the value should default to FALSE and not TRUE.

>
> It looks like a false alarm from gcc 4.5.2 (Ubuntu Natty), or at least I feel
> like it (got it here, too). If you agree, a bug ticket could be submitted to them.

It makes sense. This "fake" warning appears after I upgraded to Ubuntu
Natty. Anyway, you guys could make a quick test adding
--enable-maintainer-mode flag to configure.


--
INdT - Instituto Nokia de tecnologia
+55 2126 1122
http://techblog.briglia.net

2011-05-02 21:23:17

by Elvis Pfutzenreuter

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

On May 2, 2011, at 6:15 PM, Johan Hedberg wrote:

> Hi Briglia,
>
> On Mon, May 02, 2011, [email protected] wrote:
>> This patch fixes a compilation warning regarding btio/btio.c
>> compilation.
>> ---
>> btio/btio.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/btio/btio.c b/btio/btio.c
>> index 6d71b90..8f166cc 100644
>> --- a/btio/btio.c
>> +++ b/btio/btio.c
>> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
>> uint8_t dev_class[3];
>> uint16_t handle;
>> socklen_t len;
>> - gboolean flushable;
>> + gboolean flushable = TRUE;
>>
>> len = sizeof(l2o);
>> memset(&l2o, 0, len);
>
> I don't get the warning with my compiler, so in addition to the already
> requested compiler logs please also mention the compiler version. Also,
> the value should default to FALSE and not TRUE.

It looks like a false alarm from gcc 4.5.2 (Ubuntu Natty), or at least I feel
like it (got it here, too). If you agree, a bug ticket could be submitted to them.

2011-05-02 21:15:37

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

Hi Briglia,

On Mon, May 02, 2011, [email protected] wrote:
> This patch fixes a compilation warning regarding btio/btio.c
> compilation.
> ---
> btio/btio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/btio/btio.c b/btio/btio.c
> index 6d71b90..8f166cc 100644
> --- a/btio/btio.c
> +++ b/btio/btio.c
> @@ -800,7 +800,7 @@ static gboolean l2cap_get(int sock, GError **err, BtIOOption opt1,
> uint8_t dev_class[3];
> uint16_t handle;
> socklen_t len;
> - gboolean flushable;
> + gboolean flushable = TRUE;
>
> len = sizeof(l2o);
> memset(&l2o, 0, len);

I don't get the warning with my compiler, so in addition to the already
requested compiler logs please also mention the compiler version. Also,
the value should default to FALSE and not TRUE.

Johan

2011-05-02 20:56:37

by Antonio Ospite

[permalink] [raw]
Subject: Re: [PATCH] Remove btio.c compilation warning

On Mon, 2 May 2011 16:43:26 -0400
[email protected] wrote:

> From: Anderson Briglia <[email protected]>
>
> This patch fixes a compilation warning regarding btio/btio.c
> compilation.

Just a general observation, when fixing compilation warnings/errors it
is useful to put the actual message from the compiler in the commit log,
this helps reviewers validating the patch as they see exactly which
issue the fix addresses, but not only: there are chances the commit
message will be indexed by search engines and we'll be helping others
with similar issues searching for a solution on the web.

Regards,
Antonio

--
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


Attachments:
(No filename) (868.00 B)
(No filename) (198.00 B)
Download all attachments