Title: handle '#include MACRO' · Issue #119 · cppcheck-opensource/simplecpp · GitHub
Open Graph Title: handle '#include MACRO' · Issue #119 · cppcheck-opensource/simplecpp
X Title: handle '#include MACRO' · Issue #119 · cppcheck-opensource/simplecpp
Description: cppcheck has for some time had problems with macros with #include statements. As of 1.77 cppheck flags most of these situations as errors, which has exacerbated the situation. Here's the most simple example. #define INCLUDE_LOCATION ../s...
Open Graph Description: cppcheck has for some time had problems with macros with #include statements. As of 1.77 cppheck flags most of these situations as errors, which has exacerbated the situation. Here's the most simpl...
X Description: cppcheck has for some time had problems with macros with #include statements. As of 1.77 cppheck flags most of these situations as errors, which has exacerbated the situation. Here's the most s...
Opengraph URL: https://github.com/cppcheck-opensource/simplecpp/issues/119
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"handle '#include MACRO'","articleBody":"_cppcheck_ has for some time had problems with macros with **#include** statements. As of 1.77 _cppheck_ flags most of these situations as errors, which has exacerbated the situation.\r\n\r\nHere's the most simple example.\r\n\r\n```\r\n#define INCLUDE_LOCATION ../somewhere\r\n#define INCLUDE_FILE(F) \u003cINCLUDE_LOCATION/F.h>\r\n\r\n// Error line\r\n#include INCLUDE_FILE(header)\r\n\r\nint main()\r\n{\r\n return 0;\r\n}\r\n\r\n\r\n$ cppcheck-1.79 macroinclude.cpp\r\nChecking macroinclude.cpp ...\r\n[macroinclude.cpp:5]: (error) No header in #include\r\n```\r\nFurther: the following does not work, but in this case quietly — no error, it just doesn't do the include.\r\n\r\n```\r\n// Second example\r\n#define _1ASSTRING(token) #token\r\n#define AS_STRING(token) _1ASSTRING(token)\r\n#include AS_STRING(types.h)\r\n```\r\n\r\nWhen I investigated with _strace_, I got a slightly amusing output which gives me a hint as to what's going wrong (if not where)!\r\n\r\n```\r\nChecking macroinclude.cpp ...\r\nopen(\"NCLUDE_FIL\", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)\r\nopen(\"S_STRIN\", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)\r\n```\r\n\r\nAlthough presumably the mistake it's making wouldn't occur if the macro expansion had happened.\r\n","author":{"url":"https://github.com/fnxweb","@type":"Person","name":"fnxweb"},"datePublished":"2018-02-25T16:33:56Z","url":"https://github.com/cppcheck-opensource/simplecpp/issues/119"}
| 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:bfddc90c-55d5-97cd-1c2f-de0a40c711c6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C6E:11C2A8:63BFB:89CE4:6AFC5671 |
| html-safe-nonce | 30e7fdf2f94809015766ad55fe99acefb29e757b8c208f14021e6232d41fba22 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzZFOjExQzJBODo2M0JGQjo4OUNFNDo2QUZDNTY3MSIsInZpc2l0b3JfaWQiOiI3MTkxMDIwNjQ1NDkwOTA2NzM3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5cfbeb13d1052e5552f7768dc621580a73f07399245400ad63497b52533b2864 |
| hovercard-subject-tag | issue:300039948 |
| 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/119/issue_layout |
| twitter:image | https://opengraph.githubassets.com/67a69fc3db534b114883e8d68b5c00bd36329861ac16c1ddb41d521efcd8c1b7/cppcheck-opensource/simplecpp/issues/119 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/67a69fc3db534b114883e8d68b5c00bd36329861ac16c1ddb41d521efcd8c1b7/cppcheck-opensource/simplecpp/issues/119 |
| og:image:alt | cppcheck has for some time had problems with macros with #include statements. As of 1.77 cppheck flags most of these situations as errors, which has exacerbated the situation. Here's the most simpl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fnxweb |
| hostname | github.com |
| expected-hostname | github.com |
| None | dca5d7b31d726645ba76b526bf3a137e74fee0f5f75412c83dafde3dc9b64ccb |
| 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 | bedf3a505b023592c321f5456010d0d5a61a4e05 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width