Message308316
When using C++ to extend python, one may use PyGetSetDef for example:
static PyGetSetDef Noddy_getseters[] = {
{"first",
(getter)Noddy_getfirst, (setter)Noddy_setfirst,
"first name",
NULL},
{"last",
(getter)Noddy_getlast, (setter)Noddy_setlast,
"last name",
NULL},
{NULL} /* Sentinel */
};
However, in C++ implicit conversion from const char* to char* is deprecated since C++98, and is a removed conversion in C++11.
https://godbolt.org/g/sswUKM
GCC/Clang warn about this, and MSVC in conformance mode (/permissive-) errors on it.
PyGetSetDef and similar APIs should use const char* instead of char* for members such as `name`. |
|
Date |
User |
Action |
Args |
2017-12-14 16:32:21 | steveire | set | recipients:
+ steveire |
2017-12-14 16:32:21 | steveire | set | messageid: <1513269141.75.0.213398074469.issue32325@psf.upfronthosting.co.za> |
2017-12-14 16:32:21 | steveire | link | issue32325 messages |
2017-12-14 16:32:21 | steveire | create | |
|