All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
  2004-01-22 13:34   ` Achim Bohnet
@ 2004-01-08 15:27     ` Marcel Holtmann
  2004-01-22 18:09     ` Max Krasnyansky
  1 sibling, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2004-01-08 15:27 UTC (permalink / raw)
  To: Achim Bohnet; +Cc: BlueZ Mailing List

Hi Achim,

> That one solution, but why isn't it done by bluetooth.h itself?  Makes it header order
> independent, and fixes _once and forever_ annoying warnings like that.
> (that was my last try to convience you, promised ;)

it is not a nice programming style to include header files from another
header file. From my view only really needed headers should be included
from bluetooth.h and sys/socket.h is not needed at this point. It is
first needed when you start socket programming and if you do so I think
we can expect that you include sys/socket.h first.

> What about condition[0] etc in hci.h.  Should this be contition[] etc?
> 
> ach@allee(0) ~ $ fgrep '[0]' /usr/include/bluetooth/hci.h
>         uint8_t         condition[0];
>         uint8_t         data[0];
>         struct hci_dev_req dev_req[0];  /* hci_dev_req structures */
>         struct hci_conn_info conn_info[0];
>         struct hci_conn_info conn_info[0];

Maybe this is compiler problem, because this statement is correct.

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
@ 2004-01-22 12:47 Achim Bohnet
  2004-01-22 13:04 ` Marcel Holtmann
  0 siblings, 1 reply; 6+ messages in thread
From: Achim Bohnet @ 2004-01-22 12:47 UTC (permalink / raw)
  To: BlueZ Mailing List

Hi,
During compilation of some bluetooth apps I get lots of warings like this:

In file included from /usr/include/sys/socket.h:35,
                 from connectiondlg.h:31,
                 from connectiondlg.cpp:24:
/usr/include/bits/socket.h:91: warning: `PF_BLUETOOTH' redefined
/usr/include/bluetooth/bluetooth.h:43: warning: this is the location of the previous definition
/usr/include/bits/socket.h:123: warning: `AF_BLUETOOTH' redefined
/usr/include/bluetooth/bluetooth.h:42: warning: this is the location of the previous definition
In file included from connectiondlg.h:35,
                 from connectiondlg.cpp:24:
/usr/include/bluetooth/hci.h:482: warning: ANSI C++ forbids zero-size array `condition'
/usr/include/bluetooth/hci.h:909: warning: ANSI C++ forbids zero-size array `data'
/usr/include/bluetooth/hci.h:1046: warning: ANSI C++ forbids zero-size array `dev_req'
/usr/include/bluetooth/hci.h:1052: warning: ANSI C++ forbids zero-size array `conn_info'
/usr/include/bluetooth/hci.h:1058: warning: ANSI C++ forbids zero-size array `conn_info'

Would be nice if bluetooth.h would not override stuff already defined

sys/socket.h:123:#define AF_BLUETOOTH    PF_BLUETOOTH

I would suggest that bluetooth.h includes itself sys/socket.h before checking if AF_BLUETOOTH
is defined.   This removed the dependency on how headers are ordered in source files.
Works for me ;)

hci.h may be due to old g++2.94.4 used on debian.  No idea about a workaround :(

Achim
-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- reddy@lion.austin.ibm.com



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
  2004-01-22 12:47 [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions Achim Bohnet
@ 2004-01-22 13:04 ` Marcel Holtmann
  2004-01-22 13:34   ` Achim Bohnet
  0 siblings, 1 reply; 6+ messages in thread
From: Marcel Holtmann @ 2004-01-22 13:04 UTC (permalink / raw)
  To: Achim Bohnet; +Cc: BlueZ Mailing List

Hi Achim,

> During compilation of some bluetooth apps I get lots of warings like this:
> 
> In file included from /usr/include/sys/socket.h:35,
>                  from connectiondlg.h:31,
>                  from connectiondlg.cpp:24:
> /usr/include/bits/socket.h:91: warning: `PF_BLUETOOTH' redefined
> /usr/include/bluetooth/bluetooth.h:43: warning: this is the location of the previous definition
> /usr/include/bits/socket.h:123: warning: `AF_BLUETOOTH' redefined
> /usr/include/bluetooth/bluetooth.h:42: warning: this is the location of the previous definition
> In file included from connectiondlg.h:35,
>                  from connectiondlg.cpp:24:
> /usr/include/bluetooth/hci.h:482: warning: ANSI C++ forbids zero-size array `condition'
> /usr/include/bluetooth/hci.h:909: warning: ANSI C++ forbids zero-size array `data'
> /usr/include/bluetooth/hci.h:1046: warning: ANSI C++ forbids zero-size array `dev_req'
> /usr/include/bluetooth/hci.h:1052: warning: ANSI C++ forbids zero-size array `conn_info'
> /usr/include/bluetooth/hci.h:1058: warning: ANSI C++ forbids zero-size array `conn_info'
> 
> Would be nice if bluetooth.h would not override stuff already defined
> 
> sys/socket.h:123:#define AF_BLUETOOTH    PF_BLUETOOTH
> 
> I would suggest that bluetooth.h includes itself sys/socket.h before checking if AF_BLUETOOTH
> is defined.   This removed the dependency on how headers are ordered in source files.
> Works for me ;)
> 
> hci.h may be due to old g++2.94.4 used on debian.  No idea about a workaround :(

include "sys/socket.h" before you include "bluetooth/bluetooth.h".

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
  2004-01-22 13:04 ` Marcel Holtmann
@ 2004-01-22 13:34   ` Achim Bohnet
  2004-01-08 15:27     ` Marcel Holtmann
  2004-01-22 18:09     ` Max Krasnyansky
  0 siblings, 2 replies; 6+ messages in thread
From: Achim Bohnet @ 2004-01-22 13:34 UTC (permalink / raw)
  To: BlueZ Mailing List

On Thursday 22 January 2004 14:04, you wrote:
> Hi Achim,
> 
> > During compilation of some bluetooth apps I get lots of warings like this:
> > 
> > In file included from /usr/include/sys/socket.h:35,
> >                  from connectiondlg.h:31,
> >                  from connectiondlg.cpp:24:
> > /usr/include/bits/socket.h:91: warning: `PF_BLUETOOTH' redefined
> > /usr/include/bluetooth/bluetooth.h:43: warning: this is the location of the previous definition
> > /usr/include/bits/socket.h:123: warning: `AF_BLUETOOTH' redefined
> > /usr/include/bluetooth/bluetooth.h:42: warning: this is the location of the previous definition
> > In file included from connectiondlg.h:35,
> >                  from connectiondlg.cpp:24:
> > /usr/include/bluetooth/hci.h:482: warning: ANSI C++ forbids zero-size array `condition'
> > /usr/include/bluetooth/hci.h:909: warning: ANSI C++ forbids zero-size array `data'
> > /usr/include/bluetooth/hci.h:1046: warning: ANSI C++ forbids zero-size array `dev_req'
> > /usr/include/bluetooth/hci.h:1052: warning: ANSI C++ forbids zero-size array `conn_info'
> > /usr/include/bluetooth/hci.h:1058: warning: ANSI C++ forbids zero-size array `conn_info'
> > 
> > Would be nice if bluetooth.h would not override stuff already defined
> > 
> > sys/socket.h:123:#define AF_BLUETOOTH    PF_BLUETOOTH
> > 
> > I would suggest that bluetooth.h includes itself sys/socket.h before checking if AF_BLUETOOTH
> > is defined.   This removed the dependency on how headers are ordered in source files.
> > Works for me ;)
> > 
> > hci.h may be due to old g++2.94.4 used on debian.  No idea about a workaround :(
> 
> include "sys/socket.h" before you include "bluetooth/bluetooth.h".

Hi Marcel,

That one solution, but why isn't it done by bluetooth.h itself?  Makes it header order
independent, and fixes _once and forever_ annoying warnings like that.
(that was my last try to convience you, promised ;)

What about condition[0] etc in hci.h.  Should this be contition[] etc?

ach@allee(0) ~ $ fgrep '[0]' /usr/include/bluetooth/hci.h
        uint8_t         condition[0];
        uint8_t         data[0];
        struct hci_dev_req dev_req[0];  /* hci_dev_req structures */
        struct hci_conn_info conn_info[0];
        struct hci_conn_info conn_info[0];

Achim
> 
> Regards
> 
> Marcel
> 
> 
> 
> 

-- 
  To me vi is Zen.  To use vi is to practice zen. Every command is
  a koan. Profound to the user, unintelligible to the uninitiated.
  You discover truth everytime you use it.
                                      -- reddy@lion.austin.ibm.com



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
  2004-01-22 13:34   ` Achim Bohnet
  2004-01-08 15:27     ` Marcel Holtmann
@ 2004-01-22 18:09     ` Max Krasnyansky
  2004-01-22 22:38       ` Marcel Holtmann
  1 sibling, 1 reply; 6+ messages in thread
From: Max Krasnyansky @ 2004-01-22 18:09 UTC (permalink / raw)
  To: Achim Bohnet; +Cc: BlueZ Mailing List

On Thu, 2004-01-22 at 05:34, Achim Bohnet wrote:
> > > hci.h may be due to old g++2.94.4 used on debian.  No idea about a workaround :(
> > 
> > include "sys/socket.h" before you include "bluetooth/bluetooth.h".
> 
> Hi Marcel,
> 
> That one solution, but why isn't it done by bluetooth.h itself?  Makes it header order
> independent, and fixes _once and forever_ annoying warnings like that.
> (that was my last try to convience you, promised ;)
Actually sys/socket.h didn't have PF_\AF_ BLUETOOTH defined up till now
I guess. Mine for example (latest Fedora 1) still doesn't. Looks like
GLIBC folks pulled Bluetooth related things into standard headers. Which
is cool. We'll just have to #ifdef defines that may clash.

> What about condition[0] etc in hci.h.  Should this be contition[] etc?
> 
> ach@allee(0) ~ $ fgrep '[0]' /usr/include/bluetooth/hci.h
>         uint8_t         condition[0];
>         uint8_t         data[0];
>         struct hci_dev_req dev_req[0];  /* hci_dev_req structures */
>         struct hci_conn_info conn_info[0];
>         struct hci_conn_info conn_info[0];

No those should be [0] no []. I'm not sure why your GCC does not like
them.

Max



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions
  2004-01-22 18:09     ` Max Krasnyansky
@ 2004-01-22 22:38       ` Marcel Holtmann
  0 siblings, 0 replies; 6+ messages in thread
From: Marcel Holtmann @ 2004-01-22 22:38 UTC (permalink / raw)
  To: Max Krasnyansky; +Cc: Achim Bohnet, BlueZ Mailing List

Hi Max,

> Actually sys/socket.h didn't have PF_\AF_ BLUETOOTH defined up till now
> I guess. Mine for example (latest Fedora 1) still doesn't. Looks like
> GLIBC folks pulled Bluetooth related things into standard headers. Which
> is cool. We'll just have to #ifdef defines that may clash.

first, the file for this definitions is bits/socket.h which is included
by sys/socket.h of course. I checked my GLIBC from Debian Sid (Unstable)
which is libc6-2.3.2.ds1-11 and indeed it contains the PF_/AF_BLUETOOTH
defines. Now that the GLIBC folks included these defines, you must
include sys/socket.h before you include bluetooth/bluetooth.h. Otherwise
the compiler will complain with redefines.

I checked some more of the socket related include files and it seems
that it ok to include sys/socket.h from other include files. For example
netinet/in.h. Actually I don't like the idea to include too much files
from another header file. What do you think?

Regards

Marcel




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-01-22 22:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-22 12:47 [Bluez-devel] PF_BLUETOOTH AF_BLUETOOTH redefinitions Achim Bohnet
2004-01-22 13:04 ` Marcel Holtmann
2004-01-22 13:34   ` Achim Bohnet
2004-01-08 15:27     ` Marcel Holtmann
2004-01-22 18:09     ` Max Krasnyansky
2004-01-22 22:38       ` Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.