lionheart / openradar-mirror

A mirror of radars pulled from http://openradar.me/.
246 stars 17 forks source link

34810493: Compilation error in CoreBluetooth with macOS 10.13 SDK #18559

Open openradar-mirror opened 6 years ago

openradar-mirror commented 6 years ago

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

openradar-mirror commented 6 years ago

Modified: 2017-10-13T10:41:12.972230

openradar-mirror commented 6 years ago

Modified: 2017-10-13T10:41:12.972230