Skip to content

Extend PTS arithmetic to allow pointing to "one past" the end of a shared array #109

Description

@GoogleCodeExporter
Steve's comments moved from issue 106:

1. Is pointing to one element past the end of a shared array object valid (as 
it is for local objects by ISO/IEC 9899 6.5.6 8-9)?  If so, we should be sure 
that we get the expected behavior for those as well.  Note that this is a much 
larger change, as a lot of the spec assumes that any valid non-null 
pointer-to-shared points to an object.

This is trivial to express.  The existing equations in 6.4.2 3 define the exact 
behavior of upc_threadof() and upc_phaseof().  My proposal in comment 13 
suffices to define the behavior of upc_addrfield(), and can be trivially 
tweaked to define the local address as well.  Since you can't do 
pointer-to-shared arithmetic on generic pointers-to-shared, nor on 
pointers-to-shared whose referenced type is incomplete, we don't need to worry 
about what "one past" means in those cases, and it is well-defined for all 
others.


Original issue reported on code.google.com by danbonachea on 1 Mar 2013 at 6:25

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions