[Rpm-maint] [PATCH] mark strings extracted from PyArg_Parse* as "const"

Ales Kozumplik akozumpl at redhat.com
Thu Dec 22 10:06:39 UTC 2011


On 12/21/2011 11:40 PM, David Malcolm wrote:
> Various places within the bindings use PyArg_ParseTuple[AndKeywords]
> to extract (char*) string arguments.
>
> These are pointers to the internal representation of a PyStringObject,
> and shouldn't be modified, hence it's safest to explicitly mark these
> values as (const char*), rather than just (char*).
>
> Doing so suppresses various warnings about the above reported by the
> experimental static analysis tool I've been writing:
>     http://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
> which is part of https://fedorahosted.org/gcc-python-plugin
> ---

Applied and pushed: 
http://rpm.org/gitweb?p=rpm.git;a=commit;h=a9e6f2ab9d0d390b5147deaa066b7d1d50429704

Thanks.

Ales


More information about the Rpm-maint mailing list