Summary:
Valid code using the identifier property in the CBPeripheral and CBCentral classes fails to compile with the 10.13 SDK if -Werror=unguarded-availability is used. This happened because the identifier property was moved from the CBPeripheral and CBCentral classes (available since 10.7) to a new CBPeer base class (available since 101.3). As such, the identifier property is now marked as available "since 10.13", even though when called through either of the two derived classes, it is effectively available since 10.7. We consider this a bug in the SDK and suggest that CBPeripheral and CBCentral redeclare the identifier property with an explicit NS_AVAILABLE attribute indicating their availability since 10.7. This would retain correct behavior, as calling the property through the CBPeer base class would still require 10.13. Our workaround is shown here: https://codereview.qt-project.org/#/c/207403/5//ALL
Steps to Reproduce:
Try to build a project that calls the identifier property of a CBPeripheral or CBCentral instance and that targets macOS 10.12 or lower.
Expected Results:
No unguarded-availability warning or error is emitted.
Actual Results:
unguarded-availability warning or error is emitted.
Description
Area: Bluetooth
Summary: Valid code using the identifier property in the CBPeripheral and CBCentral classes fails to compile with the 10.13 SDK if -Werror=unguarded-availability is used. This happened because the identifier property was moved from the CBPeripheral and CBCentral classes (available since 10.7) to a new CBPeer base class (available since 101.3). As such, the identifier property is now marked as available "since 10.13", even though when called through either of the two derived classes, it is effectively available since 10.7. We consider this a bug in the SDK and suggest that CBPeripheral and CBCentral redeclare the identifier property with an explicit NS_AVAILABLE attribute indicating their availability since 10.7. This would retain correct behavior, as calling the property through the CBPeer base class would still require 10.13. Our workaround is shown here: https://codereview.qt-project.org/#/c/207403/5//ALL
Steps to Reproduce: Try to build a project that calls the identifier property of a CBPeripheral or CBCentral instance and that targets macOS 10.12 or lower.
Expected Results: No unguarded-availability warning or error is emitted.
Actual Results: unguarded-availability warning or error is emitted.
Version/Build: Xcode 9
Configuration:
- Product Version: Xcode 9 Created: 2017-10-04T13:17:28.877080 Originated: 2017-10-04T06:16:00 Open Radar Link: http://www.openradar.me/34810493