[Bug 950032] [NEW] Public bluetooth.h API requires use of GNU extensions

Ingo Ruhnke grumbel at gmx.de
Thu Mar 8 15:52:15 UTC 2012


Public bug reported:

Compiling code that uses the gcc -ansi flag no longer works with
libbluetooth-dev, as the public API now makes use of typeof() which is a
GNU extension and disabled by the -ansi flag.

$  cat main.c 
#include <bluetooth/bluetooth.h>
int main() { return 0; }

$ gcc main.c -o main -ansi
In file included from main.c:1:0:
/usr/include/bluetooth/bluetooth.h:131:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:131:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_le64’
/usr/include/bluetooth/bluetooth.h:136:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:136:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_be64’
/usr/include/bluetooth/bluetooth.h:141:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:141:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_le32’
/usr/include/bluetooth/bluetooth.h:146:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:146:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_be32’
/usr/include/bluetooth/bluetooth.h:151:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:151:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_le16’
/usr/include/bluetooth/bluetooth.h:156:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:156:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘bt_get_be16’
/usr/include/bluetooth/bluetooth.h:204:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
/usr/include/bluetooth/bluetooth.h:208:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/bluetooth/bluetooth.h:255:1: error: unknown type name ‘inline’
/usr/include/bluetooth/bluetooth.h:255:24: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ntoh64’
/usr/include/bluetooth/bluetooth.h:266:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’
/usr/include/bluetooth/bluetooth.h:274:15: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘void’

$ apt-cache policy libbluetooth-dev
libbluetooth-dev:
  Installed: 4.98-2ubuntu4
  Candidate: 4.98-2ubuntu4
  Version table:
 *** 4.98-2ubuntu4 0
        500 http://de.archive.ubuntu.com/ubuntu/ precise/main i386 Packages
        100 /var/lib/dpkg/status

$ lsb_release -rd
Description:	Ubuntu precise (development branch)
Release:	12.04

** Affects: bluez (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of
Bluetooth, which is subscribed to bluez in Ubuntu.
https://bugs.launchpad.net/bugs/950032

Title:
  Public bluetooth.h API requires use of GNU extensions

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/950032/+subscriptions



More information about the Ubuntu-bluetooth mailing list