gh-111178: fix UBSan failures in Modules/_interp*module.c - #129779
Conversation
|
It's not exactly UB, it's just that those names are reserved for the C standard. In practice, it's probably fine to leave it, and not worth the inconsistency/confusion of adding a |
|
The problem with |
|
Half the codebase is UB then! I understand the issue, but what's the actual chance that we'll get broken by prefixing something with |
|
The chance is probably almost zero but Petr wanted to avoid adding more UBs. So I guess it makes sense. By the way, I found it easier to actually type the macro without the leading underscore as well so it's also a good idea to actually ease writing! |
Half?
It is exactly UB. That's a hard fact. The C23 standard says:
Also yes. CPython is big enough that we can hope that compiler/libc authors won't actually use the In practice, new features in C nowadays tend to start with double-underscore or underscore+uppercase. Let's not use more of those -- especially in PRs that remove UB. (Speaking of technicalities: PEP-7 says “ |
|
Concerning the |
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM, with one question.

This PR fixes the UBSan failures and addresses some minor cosmetic changes. PEP-7 changes were not applied since they could scramble the diff but other semantic changes affecting the signature of touched functions may have been done.