LANGUAGE
Function
-Ec
None
None
If this non-ANSI compliant extension is enabled, a pointer to a constant type is treated 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 if some older source has to be compiled.
None
None
See the following listings for examples using -Ec conversions.
void f() { int *i; const int *j; i=j; /* C++ illegal, but OK with -Ec! */ } struct A { int i; }; void g() { const struct A *a; a->i=3; /* ANSI C/C++ illegal, but OK with -Ec! */ } void h() { const int *i; *i=23; /* ANSI-C/C++ illegal, but OK with -Ec! */ }
-Ec void foo(const int *p){ *p = 0; // Some Compilers do not issue an error.