Title: #if: wrong macro usage for macros defined before the #if · Issue #720 · cppcheck-opensource/simplecpp · GitHub
Open Graph Title: #if: wrong macro usage for macros defined before the #if · Issue #720 · cppcheck-opensource/simplecpp
X Title: #if: wrong macro usage for macros defined before the #if · Issue #720 · cppcheck-opensource/simplecpp
Description: When a macro that is already defined is used in #if / #elif, the reported MacroUsage is wrong. #define X 1 #if defined(X) #endif Expected: one use of X at line 2, col 13. Actual: no usage is reported. #define X 1 #if X #endif Expected: o...
Open Graph Description: When a macro that is already defined is used in #if / #elif, the reported MacroUsage is wrong. #define X 1 #if defined(X) #endif Expected: one use of X at line 2, col 13. Actual: no usage is report...
X Description: When a macro that is already defined is used in #if / #elif, the reported MacroUsage is wrong. #define X 1 #if defined(X) #endif Expected: one use of X at line 2, col 13. Actual: no usage is report...
Opengraph URL: https://github.com/cppcheck-opensource/simplecpp/issues/720
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"#if: wrong macro usage for macros defined before the #if","articleBody":" When a macro that is already defined is used in `#if` / `#elif`, the reported `MacroUsage` is wrong.\n\n ```c\n #define X 1\n #if defined(X)\n #endif\n ```\n\n Expected: one use of `X` at line 2, col 13.\n Actual: no usage is reported.\n\n ```c\n #define X 1\n #if X\n #endif\n ```\n\n Expected: one use of `X` at line 2, col 5.\n Actual: the same use is reported twice.\n","author":{"url":"https://github.com/danmar","@type":"Person","name":"danmar"},"datePublished":"2026-11-06T15:08:13Z","url":"https://github.com/cppcheck-opensource/simplecpp/issues/720"}
| 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:b27c67d2-fdc4-8d8a-b0c3-d48e162e9997 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E414:30D24F:3B3C67:527FF6:6AFC51C9 |
| html-safe-nonce | 25ea554426066e45c3c949228957a2c74f733a93bea55c31b2db9245e40916a1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDE0OjMwRDI0RjozQjNDNjc6NTI3RkY2OjZBRkM1MUM5IiwidmlzaXRvcl9pZCI6Ijg0OTM4NzUzMDA4NzI3Njk5OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 50c9f6b0b1cd556d27f87147d129f7fab49359c752a8385deb0ec39ae11030d6 |
| hovercard-subject-tag | issue:6245139126 |
| 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/cppcheck-opensource/simplecpp/720/issue_layout |
| twitter:image | https://opengraph.githubassets.com/deec7e5cb7d7c043f8ea50e9ce6feae1493fc1c6f8f87962401c71c15117f2ae/cppcheck-opensource/simplecpp/issues/720 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/deec7e5cb7d7c043f8ea50e9ce6feae1493fc1c6f8f87962401c71c15117f2ae/cppcheck-opensource/simplecpp/issues/720 |
| og:image:alt | When a macro that is already defined is used in #if / #elif, the reported MacroUsage is wrong. #define X 1 #if defined(X) #endif Expected: one use of X at line 2, col 13. Actual: no usage is report... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | danmar |
| hostname | github.com |
| expected-hostname | github.com |
| None | b63557e0027d8014589e873df28328da74a4356701bb1a9eab49dbf012ba8fa6 |
| turbo-cache-control | no-preview |
| go-import | github.com/cppcheck-opensource/simplecpp git https://github.com/cppcheck-opensource/simplecpp.git |
| octolytics-dimension-user_id | 278097703 |
| octolytics-dimension-user_login | cppcheck-opensource |
| octolytics-dimension-repository_id | 33434464 |
| octolytics-dimension-repository_nwo | cppcheck-opensource/simplecpp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 33434464 |
| octolytics-dimension-repository_network_root_nwo | cppcheck-opensource/simplecpp |
| 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 | 0243355b0352c83733a042e0dfb3d75149b51261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width