STINNER Victor <vstin...@python.org> added the comment:

If I build a C++ extension with -std=c++20, I get a compiler error on 
PyModuleDef_HEAD_INIT:

Modules/_testcppext.cpp:419:5: error: either all initializer clauses should be 
designated or none of them should be
  419 |     .m_name = "_testcppext",
      |     ^

Code:
---
static struct PyModuleDef module = {
    PyModuleDef_HEAD_INIT,
    .m_name = "_testcppext",
    .m_doc = module_doc,
    ...
};
---

Macro defined as (simplified code):
---
#define PyObject_HEAD_INIT(type) \
    { 1, type },

#define PyModuleDef_HEAD_INIT { \
    PyObject_HEAD_INIT(NULL)    \
    NULL, /* m_init */          \
    0,    /* m_index */         \
    NULL, /* m_copy */          \
  }
---

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39355>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to