global_ptr comparison semantics

Issue #40 resolved
Dan Bonachea created an issue

Current text for global_ptr comparison operators includes:

417 If two global pointers point to different elements of the same array, or to
418 subobjects of two different elements of the same array, then the pointer to the
419 element at the higher index compares greater than the pointer to the element
420 at the lower index. If one pointer points to an element of an array or to a
421 subobject of an element of an array, and the other pointer points one past the
422 end of the array, then the latter compares greater than the former.
...
All other comparisons result in an implementation-defined value.

The final phrase is basically covering the case of inequality comparisons between global_ptrs that point into different objects, which includes objects in different shared segments (possibly on different ranks).

The term "implementation-defined" applied to a behavior implies that a compliant implementation is responsible for documenting how it behaves in every such case. I think what we probably want here is "unspecified behavior" or "undefined behavior". The current definition of global_ptr subtraction seems to favor the latter.

Comments (1)

  1. Log in to comment