[issue30035] [RFC] PyMemberDef.name should be const char *

2017-11-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> out of date
stage:  -> resolved
status: pending -> closed

___
Python tracker 

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



[issue30035] [RFC] PyMemberDef.name should be const char *

2017-06-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

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



[issue30035] [RFC] PyMemberDef.name should be const char *

2017-04-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

PyMemberDef.name already is "const char *" in 3.7 (see issue28761).

Adding the const qualifier in other branches can break existing code that 
assigns PyMemberDef.name to a variable of type "char *". This is not 
appropriate for bugfix releases.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue30035] [RFC] PyMemberDef.name should be const char *

2017-04-10 Thread Sunyeop Lee

New submission from Sunyeop Lee:

PyMemberDef from Noddy examaple: 
https://docs.python.org/3/extending/newtypes.html

static PyMemberDef Noddy_members[] = {
{"first", T_OBJECT_EX, offsetof(Noddy, first), 0,
 "first name"},
{"last", T_OBJECT_EX, offsetof(Noddy, last), 0,
 "last name"},
{"number", T_INT, offsetof(Noddy, number), 0,
 "noddy number"},
{NULL}  /* Sentinel */
};

When compiling the code with the PyMemberDef above with GCC, it compiles well. 
However, with G++, ISO C++11 complains(warns) it is deprecated to convert 
string literal to 'char *' is deprecated 
[-Wc++11-compat-deprecated-writable-strings]

Should the example code be fixed, or should PyMemberDef fixed? I think 
PyMemberDef.name should bo const char * instead of char *.

Compiled with:
g++ test.cpp 
-I/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/include/python3.6m
 
-L/usr/local/opt/python3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/config-3.6m-darwin
 -lpython3.6m -fPIC -shared

Compiler versions:

$ gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.1.0 (clang-802.0.38)
Target: x86_64-apple-darwin16.5.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

--
components: Extension Modules
files: test.cpp
messages: 291459
nosy: Sunyeop Lee
priority: normal
severity: normal
status: open
title: [RFC] PyMemberDef.name should be const char *
type: compile error
versions: Python 3.6
Added file: http://bugs.python.org/file46795/test.cpp

___
Python tracker 

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