It is possible to assign the value of a constant object by using a non-constant value but the resulting behavior is undefined. According to C99 Section 6.7.3 Type qualifiers Paragraph 5:
If an attempt is made to modify an object defined with a const-qualified type through use of an lvalue with non-const-qualified type, the behavior is undefined.
There are existing (non-compliant) compiler implementations that allow const-qualified values to be modified without generating a warning message.
Non-Compliant Code Example
This non-compliant code example allows a constant value to be modified.
const char **cpp; char *p; const char c = 'A'; cpp = &p; // constraint violation *cpp = &c; // valid *p = 'B'; // valid
The first assignment is unsafe because it would allow the following valid code to attempt to change the
value of the const object c.
Implementation Specific
It compiles without warning on Microsoft Visual C++ .NET (2003) and on MS Visual Studio 2005. In both cases, the resulting program changes the value of c.
gcc version 3.2.2 generates a warning but compiles. The resulting program changes the value of c.
References
6.5.16.1 Simple assignment
Section 6.7.3 Type qualifiers