
Do not cast away a const
qualification on an object of pointer type. Casting away the const
qualification allows a program to modify the object referred to by the pointer, which may result in undefined behavior. See undefined behavior 64 in Appendix J of the C standard Standard [ISO/IEC 9899:2011].
As an illustration, C provides a footnote (Section 6.7.3, para. 4):
...
[ISO/IEC 9899:2011] | Section 6.7.3, "Type Qualifiers" |
---|