Author petdance
Recipients inada.naoki, petdance, serhiy.storchaka, vstinner
Date 2020-03-27.01:41:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1585273271.24.0.31611792071.issue39943@roundup.psfhosted.org>
In-reply-to
Content
It doesn't quiet any compiler warnings given the default compiler warnings that ./configure sets.  

However, it does quiet the -Wcast-qual compiler warning that could be a helpful addition some time in the future. I think it would be great, for example, if it were made impossible to send a pointer that points at a string literal into a function that would modify its contents.

Consting pointers also helps static analyzers like splint by letting it know the intent of the API.  It makes it possible for the analyzer to detect uninitialized buffers, for example.

All of the 20 or so patches that I've submitted, like BPO 39770 that you merged, have come about from my cranking up the warning options on both GCC and clang and sifting through the warnings.  My hope is that by making more things const, we can detect existing bugs and prevent new ones.

You say "I'm not sure that it's worth it to modify exiting code."  Is your concern the amount of work it would take to find the problems?  If so, it's not that much work when you let the compiler find the problems, which I've done.  I've already spent the time digging and validating.
History
Date User Action Args
2020-03-27 01:41:11petdancesetrecipients: + petdance, vstinner, inada.naoki, serhiy.storchaka
2020-03-27 01:41:11petdancesetmessageid: <1585273271.24.0.31611792071.issue39943@roundup.psfhosted.org>
2020-03-27 01:41:11petdancelinkissue39943 messages
2020-03-27 01:41:10petdancecreate