I am having problems with g ++ and the compilation process for a C / C ++ program that uses the Bluetooth libraries in Ubuntu.
If I use gcc, it works fine without warning; conversely, if I use g ++, I get this warning:
warning: with temporary address
even if the program compiles and runs.
Related error reporting lines:
bdaddr_t *inquiry(){ // do some stuff.. bacpy(&result[mote++], BDADDR_ANY); return result; } //... void zeemote(){ while (bacmp(bdaddr, BDADDR_ANY)){ /.. } }
In both cases, BDADDR_ANY is involved.
How can I resolve this warning?
BDADDR_ANY is defined in bluetooth.h as:
typedef struct { uint8_t b[6]; } __attribute__((packed)) bdaddr_t; #define BDADDR_ANY (&(bdaddr_t) {{0, 0, 0, 0, 0, 0}})
source share