Andy Lester <a...@petdance.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39943>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to