Changes between Initial Version and Version 1 of Ticket #211


Ignore:
Timestamp:
Jul 31, 2020, 8:34:51 AM (4 years ago)
Author:
pabuhr
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #211

    • Property Type changed from defect to enhancement
  • Ticket #211 – Description

    initial v1  
    11{{{
    2 int x = 0; // or int x @= 0;
    3 int y @= x;
     2int x = 0;
     3int y @= x; // invalid C initialization
    44
    55int main(void) {
     
    77}
    88}}}
    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:
     9C only allows initialization of a global variable with a constant expression; therefore, the initialization y @= x fails with the gcc error:
    1010
    1111`error: initializer element is not constant`
    1212
    13 So we are generating bad code and the error messages are a bit off.
     13which is correct.
     14
     15The enhancement is for Cforall to detect this case and print an appropriate error message instead of passing it off to the underlying C compiler.