Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Oliver Eikemeier
> Am 20.06.2024 um 14:12 schrieb Axel Wagner : > > On Thu, 20 Jun 2024 at 13:48, Oliver Eikemeier <mailto:eikeme...@fillmore-labs.com>> wrote: > > I think you should acknowledge that the spec *is* already trying to be very > clear about this. The fact that you can

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Oliver Eikemeier
> Am 20.06.2024 um 13:24 schrieb Axel Wagner : > > We can see that 1. `unsafe.Pointer` is definitionally a pointer type, 2. in > your example, the two `unsafe.Pointers` do not point to the same variable and > do not have the value `nil` and 3. are not pointing at distinct zero-sized > variable

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Oliver Eikemeier
from a pointer to a zero-sized variable. I don’t want to be stubborn. What would be the issue with at least adding a FAQ entry? I could open a PR suggesting something, although I’m not a native speaker and might not exactly hit the tone of the document. > Am 20.06.2024 um 12:37 schrieb Jan M

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-20 Thread Oliver Eikemeier
Let me start with this: I’m fine with the behavior, it is exotic enough that even the optimizer should be allowed to assume something that doesn’t hold during runtime, since it simplifies things. What I think is at least surprising and at worst lacking is the documentation. It mentions “pointer

Re: [go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-19 Thread Oliver Eikemeier
Hi, Ian Lance Taylor schrieb am Mittwoch, 19. Juni 2024 um 19:19:09 UTC+2: On Wed, Jun 19, 2024 at 9:59 AM Oliver Eikemeier wrote: > The specification says: “Pointers to distinct zero-size variables may or may not be equal.” The specs says, as you say above, "Pointers to disti

[go-nuts] Re: Comparison of pointers to distinct zero-sized variables

2024-06-19 Thread Oliver Eikemeier
Hi, Brian Candler schrieb am Mittwoch, 19. Juni 2024 um 19:17:48 UTC+2: There was a similar discussion here: https://groups.google.com/g/golang-nuts/c/JBVqWYFdtC4/m/VJC2OLJcAQAJ Thanks for the link, very insightful. I learned: 1. This gets reported about once a year

[go-nuts] Comparison of pointers to distinct zero-sized variables

2024-06-19 Thread Oliver Eikemeier
I'm observing some strange behavior and could use some help understanding it. The specification says: *“Pointers to distinct zero-size variables may or may not be equal.”* With the following program (Go Playground