Title: [C API] Build Python with `-Wundef` to detect typos in C macro names and detect undefined macros · Issue #162214 · python/cpython · GitHub
Open Graph Title: [C API] Build Python with `-Wundef` to detect typos in C macro names and detect undefined macros · Issue #162214 · python/cpython
X Title: [C API] Build Python with `-Wundef` to detect typos in C macro names and detect undefined macros · Issue #162214 · python/cpython
Description: Bug report When using #ifdef MACRO or #if defined(MACRO), the C preprocessor ignores silently error if the MACRO is not defined. If there is a typo in the macro name, it's ignored silently. I propose building Python with -Wundef (when it...
Open Graph Description: Bug report When using #ifdef MACRO or #if defined(MACRO), the C preprocessor ignores silently error if the MACRO is not defined. If there is a typo in the macro name, it's ignored silently. I propo...
X Description: Bug report When using #ifdef MACRO or #if defined(MACRO), the C preprocessor ignores silently error if the MACRO is not defined. If there is a typo in the macro name, it's ignored silently. I p...
Opengraph URL: https://github.com/python/cpython/issues/162214
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[C API] Build Python with `-Wundef` to detect typos in C macro names and detect undefined macros","articleBody":"### Bug report\n\nWhen using `#ifdef MACRO` or `#if defined(MACRO)`, the C preprocessor ignores silently error if the `MACRO` is not defined. If there is a typo in the macro name, it's ignored silently.\n\nI propose building Python with `-Wundef` (when it's supported by the C compiler) to detect usage of undefined macros.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-162215\n* gh-162218\n* gh-162221\n* gh-162220\n* gh-162222\n* gh-162223\n* gh-162225\n* gh-162226\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-11-18T15:26:45Z","url":"https://github.com/python/cpython/issues/162214"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ecbf1f80-c383-dbd1-b8e5-f2ff6dda8f60 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A746:2E9831:1359CAE:199BA6C:6B01EF01 |
| html-safe-nonce | b137a461dd0f79979427a7dd5bfd7d5c3b67dd6b5e936856ceca1bf704b10a06 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzQ2OjJFOTgzMToxMzU5Q0FFOjE5OUJBNkM6NkIwMUVGMDEiLCJ2aXNpdG9yX2lkIjoiMjAxMDMyNzQyMTEzNTQ4MjYyNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 03565f5125a125e9dddf01a980b9d2f91b55bb0f6831b37c47eaefeef1a48d65 |
| hovercard-subject-tag | issue:6470549608 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/162214/issue_layout |
| twitter:image | https://opengraph.githubassets.com/60801d0a2ab97321e708c65f4297d47ca733a877bc57631764497ff4bee1f519/python/cpython/issues/162214 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/60801d0a2ab97321e708c65f4297d47ca733a877bc57631764497ff4bee1f519/python/cpython/issues/162214 |
| og:image:alt | Bug report When using #ifdef MACRO or #if defined(MACRO), the C preprocessor ignores silently error if the MACRO is not defined. If there is a typo in the macro name, it's ignored silently. I propo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vstinner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width