LANGUAGE
Function
-Ec
None
None
Enabling this non-ANSI compliant extension allows the compiler to treat a pointer to a constant type like a pointer to the non-constant equivalent of the type. Earlier Compilers did not check a store to a constant object through a pointer. This option is useful when compiling older source code.
void f() { int *i; const int *j; i=j; /* C++ illegal, but with -Ec ok! */ } struct A { int i; }; void g() { const struct A *a; a->i=3; /* ANSI C/C++ illegal, but with -Ec ok! */ } void h() { const int *i; *i=23; /* ANSI-C/C++ illegal, but with -Ec ok! */ }
None
None
-Ec void myfun(const int *p){ *p = 0; // some Compilers do not issue an error