Skip to content

Fix extern c typedef syntax error#2438

Merged
amai2012 merged 3 commits into
cppcheck-opensource:masterfrom
RobkeBaer:fix-syntax-error-extern-c-typedef
Dec 12, 2019
Merged

Fix extern c typedef syntax error#2438
amai2012 merged 3 commits into
cppcheck-opensource:masterfrom
RobkeBaer:fix-syntax-error-extern-c-typedef

Conversation

@RobkeBaer

@RobkeBaer RobkeBaer commented Dec 9, 2019

Copy link
Copy Markdown
Contributor

Problem
extern "C" typedef void function();

Resulted in syntax error.

This will fix the garbageCollection and adds a test for it

@amai2012

amai2012 commented Dec 9, 2019

Copy link
Copy Markdown
Collaborator

https://travis-ci.org/danmar/cppcheck/jobs/622600680?utm_medium=notification&utm_source=github_status complains:

lib/tokenize.cpp:9350:5: warning: Found extra whitespace inside Token::simpleMatch() call: "extern "C" " [extraWhitespaceError]

   !Token::simpleMatch(tok->tokAt(-2), "extern \"C\" ")  )

    ^

@amai2012 amai2012 requested a review from danmar December 10, 2019 16:48

@danmar danmar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

minor tweak

Comment thread test/testgarbage.cpp Outdated
" auto fn = []() -> foo* { return new foo(); };\n"
"}\n");

checkCode(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please move this test. This code is not garbage. It should be added in TestTokenizer::findGarbageCode().

@amai2012 amai2012 merged commit 370196a into cppcheck-opensource:master Dec 12, 2019
@danmar

danmar commented Dec 21, 2019

Copy link
Copy Markdown
Collaborator

Hello! Thanks for your contribution. What name would you like that we add in our AUTHORS file?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants