title: Cannot convert value of UnsafeMutableRawPointer to BluetoothDeviceAddress
body: <p>I'm trying to convert this source code :</p>
  
  <pre><code>BluetoothDeviceAddress *deviceAddress = malloc(sizeof(BluetoothDeviceAddress));
  </code></pre>
  
  <p>to Swift, which gives me :</p>
  
  <pre><code>let deviceAddress: BluetoothDeviceAddress = malloc(sizeof(BluetoothDeviceAddress))
  </code></pre>
  
  <p>But, I found that in Swift 3/4, <code>sizeof</code> is not used anymore but this is not my error, Xcode returns :</p>
  
  <p>"Cannot convert value of type 'UnsafeMutableRawPointer!' to specified type 'BluetoothDeviceAddress'"</p>
  
  <p>I tried changing to <code>malloc(MemoryLayout&lt;BluetoothDeviceAddress&gt;.size)</code> but still the same error.</p>
  
  <p>EDIT:
  As proposed in the comments by MartinR, I tried changing to <code>let deviceAddress = BluetoothDeviceAddress()</code>
  but then when I want to initialize an IOBluetoothDevice, I still get an error (selectedDevice is a var for IOBluetoothDevice):</p>
  
  <pre><code>self.selectedDevice = IOBluetoothDevice(address: deviceAddress)
  </code></pre>
  
  <p>Error : Cannot convert value of type 'BluetoothDeviceAddress' to expected argument type 'UnsafePointer!'</p>
  
  <p>Best,</p>
  
  <p>Antoine</p>