Compilation error in CoreBluetooth with macOS 10.13 SDK
| Originator: | jake.petroules | ||
| Number: | rdar://34810493 | Date Originated: | October 4 2017, 6:16 AM |
| Status: | Duplicate of 34428271 | Resolved: | |
| Product: | macOS + SDK | Product Version: | Xcode 9 |
| Classification: | Reproducible: | Always |
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:
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!