# HG changeset patch # User Gregory Szorc # Date 1475959442 -7200 # Node ID 74cd33c9be76c11ba42ba5f2448dcf90419866ba # Parent a8c948ee3668e8fb3d17a995e220e8e22d1e8c04 parsers: use PyVarObject_HEAD_INIT The macro changed slightly in Python 3, introducing curly brackets that somehow confuse Clang into issuing a ton of compiler warnings. Using PyVarObject_HEAD_INIT makes these go away. It's worth noting that the code is identical: the 2nd argument to PyVarObject_HEAD_INIT is assigned to the ob_size field and is inserted immediately after "PyObject_HEAD_INIT(type)" is generated. Compilers are weird. diff -r a8c948ee3668 -r 74cd33c9be76 mercurial/parsers.c --- a/mercurial/parsers.c Sat Oct 08 22:21:22 2016 +0200 +++ b/mercurial/parsers.c Sat Oct 08 22:44:02 2016 +0200 @@ -2516,8 +2516,7 @@ }; static PyTypeObject indexType = { - PyObject_HEAD_INIT(NULL) - 0, /* ob_size */ + PyVarObject_HEAD_INIT(NULL, 0) "parsers.index", /* tp_name */ sizeof(indexObject), /* tp_basicsize */ 0, /* tp_itemsize */