A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2002-April/023356.html below:

[Python-Dev] getter/setter function signatures

[Python-Dev] getter/setter function signaturesThomas Heller thomas.heller@ion-tof.com
Thu, 18 Apr 2002 14:19:57 +0200
The signature for the getter/setter functions in descrobj.h is
  typedef PyObject *(*getter)(PyObject *, void *);
  typedef int (*setter)(PyObject *, PyObject *, void *);

At least descrobject.c, cPickle.c and funcobject.c defines PyGetSetDef
arrays which use function signatures where the last void* parameter is
missing. While obviously this does no harm (so far), it is surely a bug
(or am I missing something)?

-----

Related: I am always wondering, why the compiler (MSVC 6 in my case)
gives a warning when you use these signatures for getter/setter functions

   PyObject *get(wrapperobject *, void *)
   int set(wrapperobject *, PyObject *, void *)

(warning C4028: formal parameter 1 different from declaration),
while if I use these signatures

   PyObject *get(PyObject *)
   int set(PyObject *, PyObject *)

the compilation gives no warning at all. Another MSVC glitch?

Thomas





RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4