On Thu, Jan 17, 2019 at 9:22 AM Henri Menke <[email protected]> wrote:
> > In C nothing is really const, but fair enough. Maybe the attached patch > is better. > > > source/README.6coding What must be avoided with 'const' ................................. The GCC compiler warnings "assignment discards qualifiers..." and analogous warnings for "initialization", "passing arg", or "return" must be strenously avoided in our own code. The only exception is when they are caused by X11 headers or macros or other third party code. What should be avoided with 'const' ................................... A type cast, e.g., from 'const char*' to 'char*' does not solve any problems; depending on warning options, it may only hide them. Therefore such casts should be avoided whenever possible and otherwise must be carefully analyzed to make sure that they cannot cause the modification of quantities supposed to be constant. -- luigi
