Ticket #24 (defect)

Opened 1 year ago

Last modified 1 year ago

iteration_neg test needs a cast from (char *) to (int *)

Status: closed (worksforme)

Reported by: gary Assigned to: apokayi
Priority: major Milestone:
Component: component1 Version: 1.0
Keywords: guts Cc:

iteration_neg gives the following results:

-------------->      Working on unit -- iteration_neg\n
iteration_neg.upc: In function 'main':
iteration_neg.upc:50: warning: assignment from incompatible pointer type
iteration_neg.upc:53: error: Affinity expression is neither an integer nor the address of a shared object
Compilation was UNSUCCESSFUL for the negative unit [iteration_neg]
Note that this is the EXPECTED result since the unit is negative
The unit will not be run!!!
TEST PASSED for the unit [iteration_neg]

That first warning results from:

 36 int *p;
 37 
 38 int 
 39 main()
 40 {
 41         /*
 42          * To check that the expression for affinity in upc_forall
 43          * statement must be a pointer to a shared object or an integer
 44          * The compiler must raise an ERROR here !!!
 45          */
 46         
 47         int i;
 48         char a;  
 49 
 50         p = &a;

Although the test does check for the indicated error, the presence of the warning is unintended. Perhaps p can be redeclared as (char *) to avoid the warning, and still check for the intended error?

Change History

09/10/07 23:53:09: Modified by sbahra

  • owner changed from somebody to apokayi.

10/14/07 05:34:36: Modified by apokayi

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

warning vs. compiler error is a little controversial here. So I will do the (char *) cast, but I will leave the test as it is for now.