From 1320ce00c44eef3b477f40a409f654ac145cfac5 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Mon, 9 Jan 2012 16:54:24 -0800 Subject: [PATCH] spec: pointer comparison for pointers to 0-sized variables - define "0-sized" - add clarifying sentence to pointer comparison - removed notion "location" which was used only in pointer comparisons and which was never defined Fixes #2620. R=r, rsc, iant CC=golang-dev https://golang.org/cl/5528053 --- doc/go_spec.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 4e00aabf45e..0f095da814c 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,5 +1,5 @@ - + @@ -2957,7 +2956,8 @@ These terms and the result of the comparisons are defined as follows:
  • Pointer values are comparable. - Two pointer values are equal if they point to the same location or if both have value nil. + Two pointer values are equal if they point to the same variable or if both have value nil. + Pointers to distinct zero-size variables may or may not be equal.
  • @@ -5348,6 +5348,11 @@ The following minimal alignment properties are guaranteed:
  • +

    +A struct or array type has size zero if it contains no fields (or elements, respectively) that have a size greater than zero. Two distinct zero-size variables may have the same address in memory. +

    + +

    Implementation differences - TODO