Opened 15 months ago

#283 new defect

Shadowing Cause C Incompatability

Reported by: ajbeach Owned by:
Priority: major Component: cfa-cc
Version: 1.0 Keywords:
Cc:

Description

In the following program compiles in both C and Cforall but shows different behaviour in them:

#include <stdio.h>

int load = 2;

int main(void) {
    double load = 3.0;
    printf("load (as int) = %d\n", (int)load);
}

The printed number is 3 in C and 2 in Cforall.

This seems to be a result of the differing shadowing rules in C and Cforall.

Change History (0)

Note: See TracTickets for help on using tickets.