Ticket #19 (defect)

Opened 1 year ago

Last modified 1 year ago

pointer_to_shared_neg should not be a negative test

Status: closed (duplicate)

Reported by: bonachea@cs.berkeley.edu Assigned to: somebody
Priority: major Milestone:
Component: component1 Version:
Keywords: Cc:

pointer_to_shared_neg.upc:

shared int *s1;
shared int control_int_variable;

int main()
{
        /*
         * To check that pointers to shared objects cannot be cast to 
         * pointers to local objects, provided that the shared object
         * does not have affinity to the executing thread
         * the compiler MUST raise an ERROR here !!! 
         */

        int *p1;

        if(MYTHREAD == 0) {
                control_int_variable = 55;
                s1 = &control_int_variable;
                p1 = (int*) s1;
        }

        upc_barrier;

        return 0;
}

Despite the comment, this code is actually fully correct and should not generate a failure at compile or run time.

If the intent was to MYTHREAD == 1, the code would be erroneous but no compile or runtime diagnostic is required by the spec (see ticket #18).

Change History

09/25/07 18:14:59: Modified by apokayi

  • status changed from new to closed.
  • resolution set to duplicate.