Author serhiy.storchaka
Recipients ncoghlan, serhiy.storchaka
Date 2016-11-21.09:40:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1479721215.94.0.926847146167.issue28761@psf.upfronthosting.co.za>
In-reply-to
Content
Proposed patch makes the fields name and doc of structures PyMemberDef, PyGetSetDef, PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase being of type "const char *" rather of "char *".

These structures often are initialized as static variables and name and doc fields are initialized from literal strings. These fields are always refer to constant string literal, NULL, or readonly UTF8 representation of a Unicode object. They are never refer to mutable data. Changing the data referred by these pointers is an error. Adding the const qualifier makes clear that this is an immutable data.

This change may need some changes in third-party code. But it needs to change only one line in CPython sources, and I believe that most third-party projects don't need any changes at all.
History
Date User Action Args
2016-11-21 09:40:16serhiy.storchakasetrecipients: + serhiy.storchaka, ncoghlan
2016-11-21 09:40:15serhiy.storchakasetmessageid: <1479721215.94.0.926847146167.issue28761@psf.upfronthosting.co.za>
2016-11-21 09:40:15serhiy.storchakalinkissue28761 messages
2016-11-21 09:40:15serhiy.storchakacreate