GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix #653: defined() not recognizing ## token paste in its operand (GNU extension) by ludviggunne · Pull Request #694 · cppcheck-opensource/simplecpp

Conversation

@ludviggunne

@ludviggunne ludviggunne commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
ludviggunne added 2 commits August 5, 2026 14:59
@ludviggunne
add test
208326f
@ludviggunne
fix
ce06610
danmar
danmar reviewed Aug 5, 2026
View reviewed changes
Comment thread simplecpp.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread simplecpp.cpp Resolved

Uh oh!

There was an error while loading. Please reload this page.

@ludviggunne
fixes
e56a09a
danmar
danmar reviewed Aug 5, 2026
View reviewed changes
Comment thread simplecpp.cpp
macroName += defToken->next->next->next->str();
lastToken = defToken->next->next->next;
while (argTok->name) {
if (expandArg(temp, argTok, parametertokens))

@danmar danmar Aug 5, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that we should expand macros unless they are operands. will this work:

#define x
#if defined(x)

the macroName will be empty string here now? and we will think that the condition is false?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@ludviggunne ludviggunne Aug 6, 2026

Copy link
Copy Markdown
Collaborator Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works, it takes a different execution path.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
danmar
danmar reviewed Sep 1, 2026
View reviewed changes
Comment thread simplecpp.cpp
TokenList temp(files);
const Token *argTok = tok->next;
bool expectParen = false;
if (argTok->op == '(') {

@danmar danmar Sep 1, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we used to prevent null pointer dereference when tok->next is null

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@danmar danmar Sep 1, 2026

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems that sameline is not used properly anymore.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dmcppcheck

dmcppcheck commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts that must be resolved.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@danmar danmar danmar left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@ludviggunne @dmcppcheck @danmar
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.