[Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification
jeremy at alum.mit.edu
Mon Feb 13 22:58:33 CET 2006
On 2/10/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> Jeremy Hylton wrote:
> > Ok. I reviewed the original problem and you're right, the problem was
> > not that it failed outright but that it produced a warning about the
> > deprecated conversion:
> > warning: deprecated conversion from string constant to 'char*''
> > I work at a place that takes the same attitude as python-dev about
> > warnings: They're treated as errors and you can't check in code that
> > the compiler generates warnings for.
> In that specific case, I think the compiler's warning should be turned
> off; it is a bug in the compiler if that specific warning cannot be
> turned off separately.
The compiler in question is gcc and the warning can be turned off with
-Wno-write-strings. I think we'd be better off leaving that option
on, though. This warning will help me find places where I'm passing a
string literal to a function that does not take a const char*. That's
valuable, not insensate.
> While it is true that the conversion is deprecated, the C++ standard
> defines this as
> "Normative for the current edition of the Standard, but not guaranteed
> to be part of the Standard in future revisions."
> The current version is from 1998. I haven't been following closely,
> but I believe there are no plans to actually remove the feature
> in the next revision.
> FWIW, Annex D also defines these features as deprecated:
> - the use of "static" for objects in namespace scope (AFAICT
> including C file-level static variables and functions)
> - C library headers (i.e. <stdio.h>)
> Don't you get a warning when including Python.h, because that
> include <limits.h>?
> > Nonetheless, the consensus on the c++ sig and python-dev at the time
> > was to fix Python. If we don't allow warnings in our compilations, we
> > shouldn't require our users at accept warnings in theirs.
> We don't allow warnings for "major compilers". This specific compiler
> appears flawed (or your configuration of it).
More information about the Python-Dev