1

Cppcheck is the tool which analyses our CPP code. I want to create custom rule for Cppcheck to check whether all functions have comments or not. For that I need a PCRE (Pearl regex) pattern. Or any other predefined rules to address this scenarios.

Wolf
  • 9,679
  • 7
  • 62
  • 108
Hariram
  • 11
  • 2

2 Answers2

0

There are some predefined rules available @ installerlocation\cfg, what is the purpose of it? whether we can write rules using it instead of tools?

Nethaji
  • 49
  • 2
  • 6
0

I am a cppcheck author. Yes, you can write rules using PCRE expressions. But as far as I know you can't see if there are comments from a rule. As far as I know, all comments and indentation are removed before any rules are executed.

Daniel Marjamäki
  • 2,907
  • 15
  • 16
  • Is this caused by the tokenizing step that is done before cppcheck applies its rules? May it be possible that there is a "pseudo-token" for comments? Or are comments simply added to the (optional) white-space between tokens? BTW: An early *no* would make it a more pragmatic answer. – Wolf Jun 06 '14 at 05:46