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
{{ message }}
Repository navigation
sysconfig gives misleading results for USE_COMPUTED_GOTOS #57449
Actually, I think sysconfig does the right thing when it comes to all
the configure-generated HAVE_XXX variables
I agree. The 'configure' script could be improved, though. If we truly
want to enable this by default, then the defaulting should be moved to
configure. This will give a more accurate portrayal in sysconfig.
Also, we can do the USE but !HAVE check in configure, which is better
anyway because the error is caught earlier.
I am thinking something like the attached. Thoughts?
P.S. We could probably get rid of the HAVE macro all together by doing
all the work in the 'configure' script.
> P.S. We could probably get rid of the HAVE macro all together by doing
> all the work in the 'configure' script.
Would that be a breach of backward compatibility for sysconfig?
configure leaves USE_COMPUTED_GOTOS undefined in pyconfig.h.
sysconfig reads that as 0, but Python/ceval_macros.h treats it as 1, so computed gotos are actually enabled.
The fix agreed above still applies:
let configure.ac define USE_COMPUTED_GOTOS to 1 when no option is given and the compiler supports it.
Activity
vstinner commentedon Oct 21, 2011
Hum, I don't understand how, but I missed the #error failure. Computed goto *are enabled* by default.
meadori commentedon Oct 23, 2011
I agree. The 'configure' script could be improved, though. If we truly
want to enable this by default, then the defaulting should be moved to
configure. This will give a more accurate portrayal in sysconfig.
Also, we can do the USE but !HAVE check in configure, which is better
anyway because the error is caught earlier.
I am thinking something like the attached. Thoughts?
P.S. We could probably get rid of the HAVE macro all together by doing
all the work in the 'configure' script.
merwok commentedon Oct 25, 2011
This sounds good. (I know little about configure/pyconfig.h, but making sysconfig more accurate is a valuable result.)
Would that be a breach of backward compatibility for sysconfig?
meadori commentedon Oct 26, 2011
Yeah, I think so. Best to leave it alone then.
arhadthedev commentedon Apr 29, 2023
Is the issue still reprodusible on OS X?
ronaldoussoren commentedon May 2, 2023
This is with the 3.11.3 installed from python.org. So no, this doesn't seem to be reproducible on macOS.
ronaldoussoren commentedon Jun 24, 2023
Dropping the os-mac label because this isn't a Mac-specific issue.
vasiliyk commentedon Oct 22, 2026
Still reproducible on 3.16.0a1+dev:
configure leaves
USE_COMPUTED_GOTOSundefined inpyconfig.h.sysconfig reads that as 0, but
Python/ceval_macros.htreats it as 1, so computed gotos are actually enabled.The fix agreed above still applies:
let configure.ac define
USE_COMPUTED_GOTOSto 1 when no option is given and the compiler supports it.I will open a PR for this.
vasiliyk commentedon Nov 24, 2026
With PR
configure.acdefinesUSE_COMPUTED_GOTOSto 1 when no option is given and the compiler supports it.--with-computed-gotosand--without-computed-gotosstill give 1 and 0.