Changes between Initial Version and Version 1 of Ticket #211
- Timestamp:
- Jul 31, 2020, 8:34:51 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #211
-
Property
Type
changed from
defect
toenhancement
-
Property
Type
changed from
-
Ticket #211 – Description
initial v1 1 1 {{{ 2 int x = 0; // or int x @= 0;3 int y @= x; 2 int x = 0; 3 int y @= x; // invalid C initialization 4 4 5 5 int main(void) { … … 7 7 } 8 8 }}} 9 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:9 C only allows initialization of a global variable with a constant expression; therefore, the initialization y @= x fails with the gcc error: 10 10 11 11 `error: initializer element is not constant` 12 12 13 So we are generating bad code and the error messages are a bit off. 13 which is correct. 14 15 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.