Opened 4 years ago

Last modified 4 years ago

#211 new enhancement

Mutable Initializers are not Detected — at Initial Version

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

Description

int x = 0; // or int x @= 0;
int y @= x;

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

This should not compile - I ran several tests in C and the behaviour matches - and it doesn't. The issue is that C initialization does not accept all the same things as CFA and so this gets through the compiler and gcc produces the error message:

error: initializer element is not constant

So we are generating bad code and the error messages are a bit off.

Change History (0)

Note: See TracTickets for help on using tickets.