From: Robert Griesemer Date: Tue, 10 Jan 2012 00:54:24 +0000 (-0800) Subject: spec: pointer comparison for pointers to 0-sized variables X-Git-Tag: weekly.2012-01-15~107 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=1320ce00c44eef3b477f40a409f654ac145cfac5;p=gostls13.git 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 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 4e00aabf45..0f095da814 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