Not sure why warnings have begun to appear in a program that has been unchanged, aside from newer version of the BLEPeripheral Library. The code downloads and runs fine. Compiler Warning preferences are set to None. In IDE version 1.6.12, no warnings are generated. Yet for the same code in 1.8.8 I get the following. The code is from GitHub - MakeBluetooth/smart-light-switch: Example code showing how to build a smart light switch. and is attached.
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:71:16: warning: type 'struct aci_pins_t' violates one definition rule [-Wodr]
typedef struct aci_pins_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:71:16: note: a different type is defined in another translation unit
typedef struct aci_pins_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:78:10: note: the first difference of corresponding definitions is field 'reset_pin'
uint8_t reset_pin; //Recommended but optional - Set it to UNUSED when not connected
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:76:10: note: a field with different name is defined in another translation unit
uint8_t spi_clock_divider; //Required : Clock divider on the SPI clock : nRF8001 supports a maximum clock of 3MHz
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:65:16: warning: type 'struct aci_state_t' violates one definition rule [-Wodr]
typedef struct aci_state_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:65:16: note: a different type is defined in another translation unit
typedef struct aci_state_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:67:33: note: the first difference of corresponding definitions is field 'aci_pins'
aci_pins_t aci_pins; /* Pins on the MCU used to connect to the nRF8001 */
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:67:33: note: a field of same name but different type is defined in another translation unit
aci_pins_t aci_pins; /* Pins on the MCU used to connect to the nRF8001 */
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:86:3: note: type 'struct aci_pins_t' should match type 'struct aci_pins_t' that itself violate one definition rule
} aci_pins_t;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/hal_aci_tl.h:86:3: note: the incompatible type is defined here
} aci_pins_t;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: warning: type 'struct BLEPeripheral' violates one definition rule [-Wodr]
class BLEPeripheral : public BLEDeviceEventListener,
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: a different type is defined in another translation unit
class BLEPeripheral : public BLEDeviceEventListener,
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:134:36: note: the first difference of corresponding definitions is field '_advertisedServiceUuid'
const char* _advertisedServiceUuid;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:134:36: note: fields has different layout in another translation unit
const char* _advertisedServiceUuid;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/nRF8001.h:13:7: warning: type 'struct nRF8001' violates one definition rule [-Wodr]
class nRF8001 : protected BLEDevice
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/nRF8001.h:13:7: note: a different type is defined in another translation unit
class nRF8001 : protected BLEDevice
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/nRF8001.h:95:33: note: the first difference of corresponding definitions is field '_aciState'
struct aci_state_t _aciState;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/nRF8001.h:95:33: note: a field of same name but different type is defined in another translation unit
struct aci_state_t _aciState;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:65:16: note: type 'struct aci_state_t' should match type 'struct aci_state_t' that itself violate one definition rule
typedef struct aci_state_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/utility/lib_aci.h:65:16: note: the incompatible type is defined here
typedef struct aci_state_t
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLECentral.h:9:7: warning: type 'struct BLECentral' violates one definition rule [-Wodr]
class BLECentral
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLECentral.h:9:7: note: a different type is defined in another translation unit
class BLECentral
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLECentral.h:30:20: note: the first difference of corresponding definitions is field '_peripheral'
BLEPeripheral* _peripheral;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLECentral.h:30:20: note: a field of same name but different type is defined in another translation unit
BLEPeripheral* _peripheral;
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: type 'struct BLEPeripheral' should match type 'struct BLEPeripheral' that itself violate one definition rule
class BLEPeripheral : public BLEDeviceEventListener,
^
/Users/mark/Documents/Arduino/libraries/BLEPeripheral/src/BLEPeripheral.h:53:7: note: the incompatible type is defined here
class BLEPeripheral : public BLEDeviceEventListener,
^
Sketch uses 17648 bytes (54%) of program storage space. Maximum is 32256 bytes.
Global variables use 1213 bytes (59%) of dynamic memory, leaving 835 bytes for local variables. Maximum is 2048 bytes.
ble-smart-switch.ino (2.91 KB)