`UnsafeMutablePointer` didn't always have an immutable variant, and when it was
introduced there could have been many places that should have been changed to
use it, but were not. `UnsafeMutablePointer` is still pervasive. We should
survey the uses and make sure they're all using mutability only as appropriate.
The only such occurrence I found was the `dprintf` API which should have a
read-only format argument.
`UnsafeMutablePointer` didn't always have an immutable variant, and when it was
introduced there could have been many places that should have been changed to
use it, but were not. `UnsafeMutablePointer` is still pervasive. We should
survey the uses and make sure they're all using mutability only as appropriate.
The only such occurrence I found was the `dprintf` API which should have a
read-only format argument.
In that case you don't really need to go through evolution for this.
dprintf is effectively an API imported from POSIX in an overlay. We
should just fix it.
···
on Tue Jul 19 2016, Arnold Schwaighofer <swift-evolution@swift.org> wrote:
`UnsafeMutablePointer` didn't always have an immutable variant, and when
it was
introduced there could have been many places that should have been changed
to
use it, but were not. `UnsafeMutablePointer` is still pervasive. We should
survey the uses and make sure they're all using mutability only as
appropriate.
The only such occurrence I found was the `dprintf` API which should have a
read-only format argument.
On Jul 19, 2016, at 2:57 PM, Xiaodi Wu <xiaodi.wu@gmail.com> wrote:
Is this limited to auditing the stdlib only or other APIs as well with Swift overlays/API notes?
On Tue, Jul 19, 2016 at 16:47 Arnold Schwaighofer via swift-evolution <swift-evolution@swift.org> wrote:
# Replace `UnsafeMutablePointer` by `UnsafePointer` in non-mutating APIs
`UnsafeMutablePointer` didn't always have an immutable variant, and when it was
introduced there could have been many places that should have been changed to
use it, but were not. `UnsafeMutablePointer` is still pervasive. We should
survey the uses and make sure they're all using mutability only as appropriate.
The only such occurrence I found was the `dprintf` API which should have a
read-only format argument.