[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-12 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-12 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 4ae06c5337e01bdde28bce57b6b9166ad50947e3 by Serhiy Storchaka in 
branch 'master':
bpo-32241: Add the const qualifire to declarations of umodifiable strings. 
(#4748)
https://github.com/python/cpython/commit/4ae06c5337e01bdde28bce57b6b9166ad50947e3


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +4651
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32241] Add the const qualifier for char and wchar_t pointers to unmodifiable strings

2017-12-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

Py_SetProgramName() and Py_SetPythonHome() take a pointer to a string that 
shouldn't be changed for the duration of the program's execution. But the type 
of their arguments is "wchar_t *", therefore passing just a pointer to a 
constant static string will cause a compiler warning. The proposed PR changes 
the type to "const wchar_t *". This is backward compatible change.

The PR also adds the const qualifier to internal pointers that point on to 
unmodifiable strings. This could help to distinguish them from pointers on 
modifiable strings and can prevent unintentional modifications.

--
components: Interpreter Core
messages: 307802
nosy: serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Add the const qualifier for char and wchar_t pointers to unmodifiable 
strings
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com