Ticket #7 (defect)
Opened 1 year ago
Last modified 1 year ago
cast_neg incorrectly checks for compilation errror, and runtime error isn't mandated by spec.
Status: closed (fixed)
| Reported by: | gary | Assigned to: | apokayi |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | component1 | Version: | 1.0 |
| Keywords: | guts | Cc: | |
When compiled with GCC/UPC 4.0.3.4, the cast_neg test fails as follows:
--------------> Working on unit -- cast_neg\n ERROR: The NEGATIVE unit [cast_neg] pass the compilation phase The unit will not be run!!! TEST FAILED for the unit [cast_neg]
The body of the test is shown below:
/*
* To check that shared type qualifier objects cannot be cast to non-shared qualifier objects
*/
size_t thread_number;
int *prv_ptr;
/* will work only for thread 0 */
prv_ptr = (int *) &a;
thread_number = upc_threadof(&a);
Although the error condition mentioned above can be detected at runtime, I don't think it must be checked at compile time. Therefore, it is quite likely that the test will be compiled successfully.
The comment "will work only for thread 0" implies that the compiler _must_ check for this possibly erroneous situation. However, my reading of the spec. indicates that the runtime is allowed to check for this error, but it isn't required.
Note: GCC/UPC will issue an error at runtime, but BUPC/UPCR does not.
Change History
09/06/07 16:29:21: Modified by sbahra
- owner changed from somebody to apokayi.
09/24/07 15:55:44: Modified by apokayi
- status changed from new to closed.
- resolution set to fixed.

test is case dropped. Spec shows that the behaviour will be undefined. Having a check for the local thread is not necessary either.