>> Though I do not get that warning -- which compiler and version issues >> it? Is it a C or a C++ compiler? > > Well, which warning are you talking about?
I think Guido assumed that the OP was getting actual complaints from some actual compiler - else he wouldn't have asked the question. However, he didn't actually say he got compile issues. If you compile #include <Python.h> int main() { const char* s = "stdin"; PyObject_CallMethod(0, s, s); } with a g++, you get a.cc: In function ‘int main()’: a.cc:6: error: invalid conversion from ‘const char*’ to ‘char*’ a.cc:6: error: initializing argument 2 of ‘PyObject* PyObject_CallMethod(PyObject*, char*, char*, ...)’ a.cc:6: error: invalid conversion from ‘const char*’ to ‘char*’ a.cc:6: error: initializing argument 3 of ‘PyObject* PyObject_CallMethod(PyObject*, char*, char*, ...)’ If you compile #include <Python.h> int main() { PyObject_CallMethod(0, "stdin", "stdin"); } you get a.cc: In function ‘int main()’: a.cc:5: warning: deprecated conversion from string constant to ‘char*’ a.cc:5: warning: deprecated conversion from string constant to ‘char*’ Since most people likely use string literals, and since g++ only started warning about the deprecated conversion only recently, most people probably haven't run into the issue. Regards, Martin _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com