How come the gnu compiler lets this pass?
$gcc -Wall mod.c -o modCode:#include <stdio.h> #include <stdlib.h> int main(void) { char x = 1; char const *f = &x; *f=3; printf("The value is: %d \n", x); return 0; }
mod.c: In function `main':
mod.c:8: warning: assignment of read-only location
$./mod
The value is: 3
$
All the compiler does is give a warning, but lets this pass. Is this just how they chose to implement the c compiler?