# Revisiting the pointer conversions

**URL:** <https://forums.swift.org/t/revisiting-the-pointer-conversions/19363>\
**Category:** Discussion\
**Created:** [January 9, 2019, 7:44am UTC](https://forums.swift.org/t/revisiting-the-pointer-conversions/19363 "2019-01-09T07:44:00Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![benrimmington](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/benrimmington/32/695_2.png) [@benrimmington](https://forums.swift.org/u/benrimmington)\
**Post date:** [January 9, 2019, 12:14pm UTC](https://forums.swift.org/t/revisiting-the-pointer-conversions/19363/5 "2019-01-09T12:14:19Z")

</div>

> [@John\_McCall](#):
>
> - Allowing an implicit conversion from `Array`/`String` to a pointer is quite out of keeping with Swift's normal strong-typing rules. We've seen program bugs and memory corruption in the wild caused by unintended use of this feature.

The [`_convertConstStringToUTF8PointerArgument`](https://github.com/apple/swift/blob/c66a445ef7d07842718b95b47ccb5d9c46a8a29a/stdlib/public/core/Pointer.swift#L389-L396) function currently creates a temporary array. If the argument is a string literal, users might expect it to behave like a [static string](https://www.sqlite.org/bindptr.html#pointer_types_are_static_strings). This should be possible with the [new `String` ABI](https://forums.swift.org/t/string-s-abi-and-utf-8/17676/1).

> [@John\_McCall](#):
>
> - The implicit conversion from `Array`/`String` should be deprecated in favor of something that requires an explicit syntactic element (even if it's just `&`).

Should string literal arguments be exempted from the explicit `&` syntax?

---

_[View the full topic](https://forums.swift.org/t/revisiting-the-pointer-conversions/19363)._
