warning: missing field 'tp_version_tag' initializer [-Wmissing-field-initializers]
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 50/100
Piste de recherche
Commencez dans include/boost/python/opaque_pointer_converter.hpp, au niveau de l’initialiseur de opaque::type_object, et comparez ses champs avec cpython/object.h pour Python 3.11. Reproduisez l’avertissement avec Clang et les options d’avertissement indiquées, puis vérifiez que l’initialiseur n’émet plus l’avertissement missing-field-initializers.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hi,
using Clang 14/15/16 (-Wall -Wpedantic -Wextra) with Boost 1.81.0 and Python 3.11, I get the following warning at
In file included from /my/project/Source.hpp:xx:
In file included from /path/to/boost/1.81.0/include/boost/python.hpp:48:
/path/to/boost/1.81.0/include/boost/python/opaque_pointer_converter.hpp:169:1: warning: missing field 'tp_version_tag' initializer [-Wmissing-field-initializers]
Having a closer look, it seems that when defining a PyTypeObject, at .../include/boost/python/opaque_pointer_converter.hpp, the code isn't considering the last few data members:
// from .../include/python3.11/cpython/object.h
...
struct _typeobject {
...
PyObject *tp_weaklist;
destructor tp_del;
/* Type attribute cache version tag. Added in version 2.6 */
unsigned int tp_version_tag;
destructor tp_finalize;
vectorcallfunc tp_vectorcall;
};
...
// from .../include/boost/python/opaque_pointer_converter.hpp
...
template <class Pointee>
PyTypeObject opaque<Pointee>::type_object =
{
...
0, /* tp_weaklist */
#if PYTHON_API_VERSION >= 1012
0 /* tp_del */
#endif
};
...
- Langage dominant
- C++
- Étoiles
- 537
- Forks
- 223
- Merge moyen
- 11 h 22 min
- PR mergées (30 j)
- 2
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de boostorg/python
-
numpy::from_data calls vector::front and crashes (or has UB) when called with a scalar object Ouverte
Difficulté 1/5 Moins d'une heure Accessibilité débutants 84/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
-
BoostDetectToolset-1.90.0.cmake file not found in an include() call in boost_python-config.cmake Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 48/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
Toutes les issues de boostorg/python
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
duckdb/duckdb-wasm#2258 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
objectionary/eo-graphs#75 ·
-
Coarray integration tests carry no LABELS, so run_tests.py silently skips them under every backend Ouvertecoarray
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
FISCO-BCOS/FISCO-BCOS#5642 ·