You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiled with GCC's -Werror=declaration-after-statement ("intermingled declarations" in PEP-7), cpython/abstract.h (included from <Python.h>) errors on vectorcall helper functions added in 3.8.0 Beta 1.
It's well within our rights to ignore this: since 3.6 we require intermingled declarations.
But, when re-compiling Fedora we've seen several projects fail with this warning (so far: pygobject3, python-dbus, xen; more will likely come).
Dear Release Manager, should we patch 3.8 to avoid this? The patch is simple, and it would give projects that we(re) dutifully tested with the Alphas one more release to adapt.
I don't think it's worth changing for 3.9 (but if we do we should test it).
PR 13887 is fine but I would prefer to still be able to use C99 style for variable declarations. More generally, I don't think that variable declaration is the only issue: static inline function is a new shiny thing which can cause other issues with some C compilers. So I propose a different approach, bpo-37194: "Move new vector private declarations to the internal C API".
It's well within our rights to ignore this: since 3.6 we require intermingled declarations.
It's not clear from PEP-7 if we require intermingled declarations only when compiling CPython itself, or also for external packages that include CPython headers. It would be prudent to stay C89-compatible for non-internal header files.
Thanks! Enjoy C99! :-) IMHO C99 with variables in the middle of a function helps to write more reliable code: we better control the scope of a variable. It reduces the risk of using an uninitialized variable.
New changeset 9689f80 by Victor Stinner (Petr Viktorin) in branch '3.8': bpo-37191: Avoid declaration-after-statement in header included from Python.h (GH-13887) 9689f80
Activity
encukou commentedon Jun 7, 2019
When compiled with GCC's -Werror=declaration-after-statement ("intermingled declarations" in PEP-7), cpython/abstract.h (included from <Python.h>) errors on vectorcall helper functions added in 3.8.0 Beta 1.
It's well within our rights to ignore this: since 3.6 we require intermingled declarations.
But, when re-compiling Fedora we've seen several projects fail with this warning (so far: pygobject3, python-dbus, xen; more will likely come).
Dear Release Manager, should we patch 3.8 to avoid this? The patch is simple, and it would give projects that we(re) dutifully tested with the Alphas one more release to adapt.
I don't think it's worth changing for 3.9 (but if we do we should test it).
encukou commentedon Jun 7, 2019
Correction:
Anyway, we can usually take care of open-source stuff. Only take it as a litmus test for codebases we don't know about.
vstinner commentedon Jun 7, 2019
PR 13887 is fine but I would prefer to still be able to use C99 style for variable declarations. More generally, I don't think that variable declaration is the only issue: static inline function is a new shiny thing which can cause other issues with some C compilers. So I propose a different approach, bpo-37194: "Move new vector private declarations to the internal C API".
jdemeyer commentedon Jun 7, 2019
Should we revert these inline functions back to macros?
jdemeyer commentedon Jun 7, 2019
It's not clear from PEP-7 if we require intermingled declarations only when compiling CPython itself, or also for external packages that include CPython headers. It would be prudent to stay C89-compatible for non-internal header files.
lazka commentedon Jun 7, 2019
I've removed -Wdeclaration-after-statement in upstream pygobject: https://gitlab.gnome.org/GNOME/pygobject/merge_requests/119
vstinner commentedon Jun 7, 2019
New changeset 740a84d by Victor Stinner in branch 'master':
bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)
740a84d
vstinner commentedon Jun 7, 2019
Thanks! Enjoy C99! :-) IMHO C99 with variables in the middle of a function helps to write more reliable code: we better control the scope of a variable. It reduces the risk of using an uninitialized variable.
miss-islington commentedon Jun 7, 2019
New changeset 5effd10 by Miss Islington (bot) in branch '3.8':
bpo-37191: Move TestPEP590 from test_capi to test_call (GH-13892)
5effd10
vstinner commentedon Jun 7, 2019
New changeset 9689f80 by Victor Stinner (Petr Viktorin) in branch '3.8':
bpo-37191: Avoid declaration-after-statement in header included from Python.h (GH-13887)
9689f80
vstinner commentedon Jun 13, 2019
Petr Viktorin fixed the issue, thanks ;-)