unsafe
's safety
rules allow converting an unsafe.Pointer
into uintptr
when calling certain
functions. Previously, in some cases, the compiler allowed multiple
chained conversions (for example, syscall.Syscall(…,
uintptr(uintptr(ptr)),
…)
). The compiler
now requires exactly one conversion. Code that used multiple
conversions should be updated to satisfy the safety rules.
Packageunsafe
's safety rules allow converting anunsafe.Pointer
intouintptr
when calling certain functions. Previously, in some cases, the compiler allowed multiple chained conversions (for example,syscall.Syscall(…,
uintptr(uintptr(ptr)),
…)
). The compiler now requires exactly one conversion. Code that used multiple conversions should be updated to satisfy the safety rules.I didn't find the difference from Go 1.14.
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0f62c576-a1f9-467e-b99c-42f01edaa452o%40googlegroups.com.
uintptr(uintptr(ptr))"
a typo? Or are there any other multiple chained conversions examples?AIUI: The safety rules haven't changed. How the compiler interprets them has. Previously, it interpreted them so as to allow multiple chained conversions. Now it doesn't.
On Fri, Jun 12, 2020 at 2:28 PM T L <tapi...@gmail.com> wrote:
--Packageunsafe
's safety rules allow converting anunsafe.Pointer
intouintptr
when calling certain functions. Previously, in some cases, the compiler allowed multiple chained conversions (for example,syscall.Syscall(…,
uintptr(uintptr(ptr)),
…)
). The compiler now requires exactly one conversion. Code that used multiple conversions should be updated to satisfy the safety rules.I didn't find the difference from Go 1.14.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
On Fri, Jun 12, 2020 at 9:56 AM T L <tapi...@gmail.com> wrote:
>
> Is "uintptr(uintptr(ptr))" a typo? Or are there any other multiple chained conversions examples?
That is not a typo. That is the case that worked in 1.14 and does not
work in 1.15.
Ian
> On Friday, June 12, 2020 at 12:47:03 PM UTC-4, Axel Wagner wrote:
>>
>> AIUI: The safety rules haven't changed. How the compiler interprets them has. Previously, it interpreted them so as to allow multiple chained conversions. Now it doesn't.
>>
>> On Fri, Jun 12, 2020 at 2:28 PM T L <tapi...@gmail.com> wrote:
>>>
>>>
>>> Package unsafe's safety rules allow converting an unsafe.Pointer into uintptr when calling certain functions. Previously, in some cases, the compiler allowed multiple chained conversions (for example, syscall.Syscall(…, uintptr(uintptr(ptr)), …)). The compiler now requires exactly one conversion. Code that used multiple conversions should be updated to satisfy the safety rules.
>>>
>>>
>>> I didn't find the difference from Go 1.14.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0f62c576-a1f9-467e-b99c-42f01edaa452o%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6139806c-8937-4f71-97a0-eae51fecdb8co%40googlegroups.com.
On Fri, Jun 12, 2020 at 10:08 AM T L <tapi...@gmail.com> wrote:
>
> On Friday, June 12, 2020 at 1:02:30 PM UTC-4, Ian Lance Taylor wrote:
>>
>> On Fri, Jun 12, 2020 at 9:56 AM T L <tapi...@gmail.com> wrote:
>> >
>> > Is "uintptr(uintptr(ptr))" a typo? Or are there any other multiple chained conversions examples?
>>
>> That is not a typo. That is the case that worked in 1.14 and does not
>> work in 1.15.
>>
>> Ian
>>
>
> So "uintptr(unsafe.Pointer(ptr))" also doesn't work now?
No, that continues to work as before. Nobody has said anything about that case.
Again: the case that no longer works is uintptr(uintptr(ptr)).
Ian
>> > On Friday, June 12, 2020 at 12:47:03 PM UTC-4, Axel Wagner wrote:
>> >>
>> >> AIUI: The safety rules haven't changed. How the compiler interprets them has. Previously, it interpreted them so as to allow multiple chained conversions. Now it doesn't.
>> >>
>> >> On Fri, Jun 12, 2020 at 2:28 PM T L <tapi...@gmail.com> wrote:
>> >>>
>> >>>
>> >>> Package unsafe's safety rules allow converting an unsafe.Pointer into uintptr when calling certain functions. Previously, in some cases, the compiler allowed multiple chained conversions (for example, syscall.Syscall(…, uintptr(uintptr(ptr)), …)). The compiler now requires exactly one conversion. Code that used multiple conversions should be updated to satisfy the safety rules.
>> >>>
>> >>>
>> >>> I didn't find the difference from Go 1.14.
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
>> >>> To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
>> >>> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/0f62c576-a1f9-467e-b99c-42f01edaa452o%40googlegroups.com.
>> >
>> > --
>> > You received this message because you are subscribed to the Google Groups "golang-nuts" group.
>> > To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
>> > To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6139806c-8937-4f71-97a0-eae51fecdb8co%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/12d0fa65-0364-4da1-bf9a-dd6b4cef39e3o%40googlegroups.com.