Ticket #20 (defect)

Opened 1 year ago

Last modified 1 year ago

cast test incorrectly applies blocksize to void type

Status: closed (fixed)

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

When compiled with GCC/UPC 4.0.3.4, the "cast" test fails as follows:

>-------------->      Working on unit -- cast
COMPILER ERROR: The unit [cast] cannot be compiled
The unit will not be run!!!
cast.upc: In function 'main':
cast.upc:69: error: layout qualifier cannot be applied to a void type

The body of the test follows:

shared int *p;
[...]

        /*
         * To check that if a generic pointer-to-shared is cast to a non generic
         * pointer-to-shared type with block size of one, the result is a pointer with a phase of zero
         */

        number_phase = upc_phaseof(((shared[1] void *)p));

        if(number_phase != 0)
                GULA_FAIL("failed to setup the correct phase");

Above, the cast to (shared [1] void *) appears to be in error, as the compiler's diagnostic message indicates. It looks to me as if the test is backwards, becuase 'p' is not a generic PTS, but rather a PTS to a "shared int", and the cast being attempted is trying to convert to a generic PTS rather than a regular PTS.

Change History

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

  • owner changed from somebody to apokayi.

10/14/07 05:10:11: Modified by apokayi

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

semantics 6.4.3.3 is applied correctly by using a generic to non-generic cast for pointers q1 and q2