René's URL Explorer Experiment


Title: Restructure the preprocessor to follow the standard's translation phases · Issue #708 · cppcheck-opensource/simplecpp · GitHub

Open Graph Title: Restructure the preprocessor to follow the standard's translation phases · Issue #708 · cppcheck-opensource/simplecpp

X Title: Restructure the preprocessor to follow the standard's translation phases · Issue #708 · cppcheck-opensource/simplecpp

Description: simplecpp's output is correct for most code, and it passes nearly all the macro examples from C11 §6.10.3.5 and the C23/C++20 __VA_OPT__ examples. But the code doesn't follow the translation phases in C §5.1.1.2 and C++ [lex.phases], and...

Open Graph Description: simplecpp's output is correct for most code, and it passes nearly all the macro examples from C11 §6.10.3.5 and the C23/C++20 __VA_OPT__ examples. But the code doesn't follow the translation phases...

X Description: simplecpp's output is correct for most code, and it passes nearly all the macro examples from C11 §6.10.3.5 and the C23/C++20 __VA_OPT__ examples. But the code doesn't follow the translatio...

Opengraph URL: https://github.com/cppcheck-opensource/simplecpp/issues/708

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Restructure the preprocessor to follow the standard's translation phases","articleBody":"  simplecpp's output is correct for most code, and it passes nearly all the macro examples\n  from C11 §6.10.3.5 and the C23/C++20 `__VA_OPT__` examples. But the code doesn't follow\n  the translation phases in C §5.1.1.2 and C++ [lex.phases], and that causes bugs.\n  Comparing with `gcc -E` shows these differences:\n\n  - **Line joining (phase 2)** happens after tokenizing, so `ab\\\u003cnewline>cd` becomes two tokens.\n  - **Tokenizing (phase 3)** splits the input into single characters and joins them again in\n    `combineOperators()`. Numbers like `0x1e+e` and `1.2.3` are split, and `\u003c=>`, `->*`, `.*`\n    and digraphs aren't supported.\n  - **`#line`** is handled while the file is read. It takes effect inside `#if 0` and does not\n    expand macros.\n  - **`#elif`** is evaluated even after an earlier group was taken.\n  - **`#if` arithmetic** has no unsigned math (`-1 > 0u` is false) and no short-circuit\n    (`0 && (1/0)` is an error). `true` is 0 in C++.\n  - **`##`** is checked against a hand-written list: valid `\u003c\u003c=`, `->` and `&&` are rejected,\n    and invalid `..` is accepted.\n  - **`#`** escapes every backslash (`str(\\n)` gives `\"\\\\n\"`) and drops the space a comment\n    stands for.\n  - **Macro expansion** approximates the standard rescanning rules with an expanded-macro set\n    and special cases, instead of hide sets.\n\n  Proposed steps, each one a separate PR:\n  1. Small fixes: `#line` in the directive loop, skip `#elif` after a taken group, a new\n     `#if` evaluator, fix `#` escaping.\n  2. Do line joining in the character stream, and replace `combineOperators()` with a\n     longest-match tokenizer.\n  3. Move cppcheck-specific changes (raw-string conversion, `&=` split, `#`/`##` in plain\n     text) to options applied to the output.\n  4. Rewrite macro expansion using Prosser's hide-set algorithm.\n\n  The full report with test cases is attached (`preprocessing-report.md`).\n\n  You may want to split it into one main issue for the restructure and separate small issues for the step 1 bugs (#line, #elif, #if arithmetic). Each of those can be fixed on its own.\n\n[preprocessing-report.md](https://github.com/user-attachments/files/34372683/preprocessing-report.md)","author":{"url":"https://github.com/danmar","@type":"Person","name":"danmar"},"datePublished":"2026-11-04T12:56:15Z","url":"https://github.com/cppcheck-opensource/simplecpp/issues/708"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:a02bf1be-8104-8913-83d4-c83145d0d45a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idADEC:27C34C:1B7ADF:2763EA:6AFC4AC0
html-safe-nonce58b3ffce2ec1b1cc839cae2d20cd67160ce9c041bbb179f1ce4f625af18fca52
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBREVDOjI3QzM0QzoxQjdBREY6Mjc2M0VBOjZBRkM0QUMwIiwidmlzaXRvcl9pZCI6IjcxOTg1ODQxMDAwNzkwMjg5MjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac5e085ef8accffba8abfb91b84c970162232c28cf55ca49913a6c6f7b311d11ce
hovercard-subject-tagissue:6203149193
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cppcheck-opensource/simplecpp/708/issue_layout
twitter:imagehttps://opengraph.githubassets.com/285d99ca7989d61fa6d4d756441f2de46147bfa6e19d0fff4c3d138ebf322269/cppcheck-opensource/simplecpp/issues/708
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/285d99ca7989d61fa6d4d756441f2de46147bfa6e19d0fff4c3d138ebf322269/cppcheck-opensource/simplecpp/issues/708
og:image:altsimplecpp's output is correct for most code, and it passes nearly all the macro examples from C11 §6.10.3.5 and the C23/C++20 __VA_OPT__ examples. But the code doesn't follow the translation phases...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanmar
hostnamegithub.com
expected-hostnamegithub.com
None20dfdada12bc00bbf8065dc10dfe3ff3711b85db5cc117f83296f8074e861960
turbo-cache-controlno-preview
go-importgithub.com/cppcheck-opensource/simplecpp git https://github.com/cppcheck-opensource/simplecpp.git
octolytics-dimension-user_id278097703
octolytics-dimension-user_logincppcheck-opensource
octolytics-dimension-repository_id33434464
octolytics-dimension-repository_nwocppcheck-opensource/simplecpp
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id33434464
octolytics-dimension-repository_network_root_nwocppcheck-opensource/simplecpp
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release041909865f220ab51714e7efdc276dd349a99ade
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/cppcheck-opensource/simplecpp/issues/708#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcppcheck-opensource%2Fsimplecpp%2Fissues%2F708
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcppcheck-opensource%2Fsimplecpp%2Fissues%2F708
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cppcheck-opensource%2Fsimplecpp
Reloadhttps://github.com/cppcheck-opensource/simplecpp/issues/708
Reloadhttps://github.com/cppcheck-opensource/simplecpp/issues/708
Reloadhttps://github.com/cppcheck-opensource/simplecpp/issues/708
cppcheck-opensourcehttps://github.com/cppcheck-opensource
simplecpphttps://github.com/cppcheck-opensource/simplecpp
Codehttps://github.com/cppcheck-opensource/simplecpp
Issues86 (86)https://github.com/cppcheck-opensource/simplecpp/issues
Pull requests36 (36)https://github.com/cppcheck-opensource/simplecpp/pulls
Actionshttps://github.com/cppcheck-opensource/simplecpp/actions
Wikihttps://github.com/cppcheck-opensource/simplecpp/wiki
Security and qualityhttps://github.com/cppcheck-opensource/simplecpp/security
Insightshttps://github.com/cppcheck-opensource/simplecpp/pulse
https://github.com/cppcheck-opensource/simplecpp
New issuehttps://github.com/login?return_to=https://github.com/cppcheck-opensource/simplecpp/issues/708
New issuehttps://github.com/login?return_to=https://github.com/cppcheck-opensource/simplecpp/issues/708
Taskhttps://github.com/cppcheck-opensource/simplecpp/issues?q=type:"Task"
Restructure the preprocessor to follow the standard's translation phaseshttps://github.com/cppcheck-opensource/simplecpp/issues/708#top
https://github.com/danmar
danmarhttps://github.com/danmar
on Nov 4, 2026https://github.com/cppcheck-opensource/simplecpp/issues/708#issue-6203149193
preprocessing-report.mdhttps://github.com/user-attachments/files/34372683/preprocessing-report.md
danmarhttps://github.com/danmar
Taskhttps://github.com/cppcheck-opensource/simplecpp/issues?q=type:"Task"
on Nov 4, 2026https://github.com/cppcheck-opensource/simplecpp/issues/708#event-35129289181
danmarhttps://github.com/danmar
on Nov 8, 2026https://github.com/cppcheck-opensource/simplecpp/issues/708#event-35138237958
#elif condition is evaluated after a previous group was taken #709https://github.com/cppcheck-opensource/simplecpp/issues/709
#if true evaluates to false in C++ and C23 #711https://github.com/cppcheck-opensource/simplecpp/issues/711
# operator escapes backslashes outside string literals #714https://github.com/cppcheck-opensource/simplecpp/issues/714
#if: && and || are evaluated with the same precedence #716https://github.com/cppcheck-opensource/simplecpp/issues/716
# operator drops the space that a comment stands for #718https://github.com/cppcheck-opensource/simplecpp/issues/718
#if: wrong macro usage for macros defined before the #if #720https://github.com/cppcheck-opensource/simplecpp/issues/720
#if: &&, || and ?: short-circuit #722https://github.com/cppcheck-opensource/simplecpp/issues/722
##: valid token pastes are rejected #724https://github.com/cppcheck-opensource/simplecpp/issues/724
#line takes effect inside skipped groups and does not expand macros #734https://github.com/cppcheck-opensource/simplecpp/issues/734
Refactoring: split TokenList::readfile() into smaller functions #735https://github.com/cppcheck-opensource/simplecpp/issues/735
Refactoring: separate the cppcheck-specific &= handling from TokenList::combineOperators() #737https://github.com/cppcheck-opensource/simplecpp/issues/737
Add a lookahead buffer to TokenList::Stream #739https://github.com/cppcheck-opensource/simplecpp/issues/739
Handle line splicing (backslash-newline) in TokenList::Stream #741https://github.com/cppcheck-opensource/simplecpp/issues/741
Add a macro expander that uses hide sets #742https://github.com/cppcheck-opensource/simplecpp/issues/742
Sign up for freehttps://github.com/signup?return_to=https://github.com/cppcheck-opensource/simplecpp/issues/708
Sign in to commenthttps://github.com/login?return_to=https://github.com/cppcheck-opensource/simplecpp/issues/708
Taskhttps://github.com/cppcheck-opensource/simplecpp/issues?q=type:"Task"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.