fix build
PATCH v3 1/1 fix build
src/eir.c: In function 'eir_parse':src/eir.c:72: error: 'name_len' may be used uninitialized in this function
and
thermometer/thermometer.c: In function 'destroy_char':thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'
--- src/eir.c | 2 +- thermometer/thermometer.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)
src/eir.c +1 -1
@@ -69,7 +69,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)uuid_t service;char *uuid_str;const char *name =NULL ; -size_t name_len; +size_t name_len =0 ;unsigned int i; eir->flags =-1 ;
thermometer/thermometer.c +5 -0
@@ -20,6 +20,10 @@* */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <gdbus.h> #include <errno.h> #include <bluetooth/uuid.h>
@@ -34,6 +38,7 @@#include "att.h" #include "gatt.h" #include "thermometer.h" +#include "glib-helper.h" #define THERMOMETER_INTERFACE "org.bluez.Thermometer"
Signature · 1 line
1.7.1
Marcel Holtmann
maintainerHi Frederic,
Quoted 7 lines
src/eir.c: In function 'eir_parse':src/eir.c:72: error: 'name_len' may be used uninitialized in this functionand
thermometer/thermometer.c: In function 'destroy_char':thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'
please split this into two patches.
The fix for thermometer/thermometer.c is fine, but for src/eir.c I think it is better to rewrite that function with a more clean and simpler version.
Regards
Marcel
Quoted 17 lines · Frédéric Danis
src/eir.c: In function 'eir_parse':src/eir.c:72: error: 'name_len' may be used uninitialized in this functionand
thermometer/thermometer.c: In function 'destroy_char':thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'--- src/eir.c | 2 +- thermometer/thermometer.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)src/eir.c +0
-0
src/eir.c int eir_parse(struct eir_data *eir, uint8_t *eir_data) · line 72
Quoted 5 lines
src/eir.c +1
-1@@ -69,7 +69,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)uuid_t service;char *uuid_str;const char *name =NULL ; -size_t name_len; +size_t name_len =0 ;
BTW: shall we change build flags otherwise bluez is not building anymore.
make
make --no-print-directory all-am
CC src/eir.o
cc1: warnings being treated as errorssrc/eir.c: In function ‘eir_parse’:src/eir.c:73:9: error: ‘name_len’ may be used uninitialized in this function
make[1]: *** [src/eir.o] Ошибка 1
make: *** [all] Ошибка 2
Best regards
Andrei Emeltchenko
Quoted 33 lines
src/eir.c +0
-0unsigned int i; eir->flags =-1 ;thermometer/thermometer.c +5
-0@@ -20,6 +20,10 @@* */ +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif +#include <gdbus.h> #include <errno.h> #include <bluetooth/uuid.h> @@ -34,6 +38,7 @@#include "att.h" #include "gatt.h" #include "thermometer.h" +#include "glib-helper.h" #define THERMOMETER_INTERFACE "org.bluez.Thermometer"Signature · 6 lines
1.7.1 -- 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
Marcel Holtmann
maintainerHi Andrei,
Quoted 25 lines
Quoted 17 lines
src/eir.c: In function 'eir_parse':src/eir.c:72: error: 'name_len' may be used uninitialized in this functionand
thermometer/thermometer.c: In function 'destroy_char':thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'--- src/eir.c | 2 +- thermometer/thermometer.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)src/eir.c +0
-0src/eir.c int eir_parse(struct eir_data *eir, uint8_t *eir_data) · line 72
Quoted 5 lines
src/eir.c +1
-1@@ -69,7 +69,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)uuid_t service;char *uuid_str;const char *name =NULL ; -size_t name_len; +size_t name_len =0 ;BTW: shall we change build flags otherwise bluez is not building anymore.
Quoted 9 lines
make
make --no-print-directory all-am
CCsrc/eir.o
cc1: warnings being treated as errorssrc/eir.c: In function ‘eir_parse’:src/eir.c:73:9: error: ‘name_len’ may be used uninitialized in this function
make[1]: *** [src/eir.o] Ошибка 1
make: *** [all] Ошибка 2
it builds fine if you install a recent distro with a recent gcc.
Regards
Marcel
Hi Marcel,
Quoted 35 lines · Marcel Holtmann
Quoted 25 lines
Quoted 17 lines
src/eir.c: In function 'eir_parse':src/eir.c:72: error: 'name_len' may be used uninitialized in this functionand
thermometer/thermometer.c: In function 'destroy_char':thermometer/thermometer.c:79: error: implicit declaration of function 'g_slist_free_full'--- src/eir.c | 2 +- thermometer/thermometer.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletions(-)src/eir.c +0
-0src/eir.c int eir_parse(struct eir_data *eir, uint8_t *eir_data) · line 72
Quoted 5 lines
src/eir.c +1
-1@@ -69,7 +69,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)uuid_t service;char *uuid_str;const char *name =NULL ; -size_t name_len; +size_t name_len =0 ;BTW: shall we change build flags otherwise bluez is not building anymore.
Quoted 9 lines
make
make --no-print-directory all-am
CCsrc/eir.o
cc1: warnings being treated as errorssrc/eir.c: In function ‘eir_parse’:src/eir.c:73:9: error: ‘name_len’ may be used uninitialized in this function
make[1]: *** [src/eir.o] Ошибка 1
make: *** [all] Ошибка 2
Quoted 1 line
it builds fine if you install a recent distro with a recent gcc.
What is the recent gcc I need to have? I have Ubuntu 11.04 with gcc:
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
Actually several weeks ago new Ubuntu was introduced 11.10, hopefully they have right gcc :-)
Best regards
Andrei Emeltchenko