mc-imperial / dredd

Framework for evaluating C/C++ compiler testing tools
Apache License 2.0
11 stars 3 forks source link

Dredd failed to rewrite const array size in struct #290

Closed JonathanFoo0523 closed 1 month ago

JonathanFoo0523 commented 1 month ago

Applying dredd to

int main() {
  const int a = 0;
  struct b {
    int bar[a];
  };
}

results in

int main() {
  const int a = __dredd_replace_expr_int_zero(0, 0);
  struct b {
    int bar[a];
  };
}

This results in the following compilation error

error: fields must have a constant size: 'variable length array in structure' extension will never be supported
afd commented 1 month ago

Another one to be solved via rewriting. Are you happy to take it along with the others?