Title: defined() not recognizing ## token paste in its operand (GNU extension) · Issue #653 · cppcheck-opensource/simplecpp · GitHub
Open Graph Title: defined() not recognizing ## token paste in its operand (GNU extension) · Issue #653 · cppcheck-opensource/simplecpp
X Title: defined() not recognizing ## token paste in its operand (GNU extension) · Issue #653 · cppcheck-opensource/simplecpp
Description: When defined() appears inside a macro with ## op, syntaxError gets emitted. error: failed to evaluate #if condition, undefined function-like macro invocation: defined( ... ) [syntaxError] #if NRF_MODULE_ENABLED(FOO) Reproducer: main.c #d...
Open Graph Description: When defined() appears inside a macro with ## op, syntaxError gets emitted. error: failed to evaluate #if condition, undefined function-like macro invocation: defined( ... ) [syntaxError] #if NRF_M...
X Description: When defined() appears inside a macro with ## op, syntaxError gets emitted. error: failed to evaluate #if condition, undefined function-like macro invocation: defined( ... ) [syntaxError] #if NRF_M...
Opengraph URL: https://github.com/cppcheck-opensource/simplecpp/issues/653
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"defined() not recognizing ## token paste in its operand (GNU extension)","articleBody":"\nWhen defined() appears inside a macro with ## op, syntaxError gets emitted.\n\u003e error: failed to evaluate #if condition, undefined function-like macro invocation: defined( ... ) [syntaxError]\n\u003e #if NRF_MODULE_ENABLED(FOO)\n\nReproducer: main.c\n```c\n#define NRF_MODULE_ENABLED(module) \\\n (defined(module ## _ENABLED) \u0026\u0026 (module ## _ENABLED))\n\n#define FOO_ENABLED 1\n\n#if NRF_MODULE_ENABLED(FOO)\nint foo(void) { return 1; }\n#endif\n```\nThis is caused by the DEFINED branch in expandToken, which doesn't match defined(A ## B), and makes the token 'defined(...)' fall through.","author":{"url":"https://github.com/wjakobsson","@type":"Person","name":"wjakobsson"},"datePublished":"2026-05-21T09:03:45.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/653/simplecpp/issues/653"}
| 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:019dd3ed-edf5-ba9e-f36f-3c40a4ad1f15 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A40C:3804:3FA540:56282B:6A4DA1CA |
| html-safe-nonce | 64ee320775fc64975f2b32490c3ee911177231ce5a5091dc395c4fc03c79b610 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDBDOjM4MDQ6M0ZBNTQwOjU2MjgyQjo2QTREQTFDQSIsInZpc2l0b3JfaWQiOiIxMjUxMTAyNjkzNTQ1MzIwOTA2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5dde5a531eaf913cabfb947763b4c8a28b8ebd409837bfe9185ed4eb21740dac |
| hovercard-subject-tag | issue:4493214382 |
| 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/653/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8b34042bd933f17604534f1bfbcac2dbed57ed6c56c8fd135c9859517747808/cppcheck-opensource/simplecpp/issues/653 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8b34042bd933f17604534f1bfbcac2dbed57ed6c56c8fd135c9859517747808/cppcheck-opensource/simplecpp/issues/653 |
| og:image:alt | When defined() appears inside a macro with ## op, syntaxError gets emitted. error: failed to evaluate #if condition, undefined function-like macro invocation: defined( ... ) [syntaxError] #if NRF_M... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | wjakobsson |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| 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 | 7f13faa65cccc9b729d674da83335d5dcfdfd193 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width