Opened 4 years ago

Last modified 4 years ago

#211 new enhancement

Mutable Initializers are not Detected

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

Description (last modified by pabuhr)

int x = 0;
int y @= x; // invalid C initialization

int main(void) {
    return (x + y);
}

C only allows initialization of a global variable with a constant expression; therefore, the initialization y @= x fails with the gcc error:

error: initializer element is not constant

which is correct.

The enhancement is for Cforall to detect this case and print an appropriate error message instead of passing it off to the underlying C compiler.

Change History (1)

comment:1 Changed 4 years ago by pabuhr

Description: modified (diff)
Type: defectenhancement
Note: See TracTickets for help on using tickets.