MATLAB: Do I receive a compilation error for the analysis with enum in PolySpace

Polyspace Code ProverPolyspace Code Prover Server

I use the following simple code to define an enumeration:
enum EnumTyp {A,B,C,D} ;
int main(void)
{ EnumTyp x;
x = A;
x = x + B;
}
But I get the following error message in PolySpace when starting my C-analysis:
Verifying PolySpace_enum_test.c
test.c:4: undeclared identifier `EnumTyp'
test.c:4: syntax error; found `x' expecting `;'
test.c:4: undeclared identifier `x'

Best Answer

For a valid declaration of enum in C, use the code below:
enum EnumTyp {A,B,C,D} ;
int main(void)
{ enum EnumTyp x;
x = A;
x = x + B;
}
The code original code is valid for an enum declaration in C++.