Well, this error message was recently added: https://github.com/danmar/cppcheck/pull/3343/files . But the format of the rules files has not been changed. Only error message was added. So, this error with suppressions was even when you were using Cppcheck 2.1, but you didn't see any errors.
I'm not sure about the format of rule files from your message. You need something like this:
Appendix A Summary of guidelines
Rule 1.1 Required
text of rule 1.1
Rule 1.2 Advisory
text of rule 1.2
etc.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I did some poking around, and it looks like the rules parser doesn't handle multi-line rules or rule text that starts with a special character . I'd been adding rules with multiple parts like this:
Rule x.y Required
(a) Rule x.y part a
(b) Rule x.y part b
If I remove the parenthesis and make the rule a single line, like this:
Rule x.y Required
Rule x.y part a;Rule x.y part b
The parser appears to work.
Regarding 'special characters', it appears that any non-alphanumeric character causes a rule to fail to parse, for example, the following will not be parsed:
Rule x.y Required
'quoted words' in a rule text
Thank you for pointing me in the right direction!
Last edit: Mike Banducci 2021-08-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a MISRA rules file that worked with cppcheck 2.1, but with 2.5, the rules are not being parsed.
My file is the format shown in the repo:
The cppcheck gui, however, shows:
Has the format changed, or is this a bug with the misra scripts?
Thanks!
Last edit: Mike Banducci 2021-08-13
hmm strange as far as I know we have not changed the format.
Well, this error message was recently added: https://github.com/danmar/cppcheck/pull/3343/files . But the format of the rules files has not been changed. Only error message was added. So, this error with suppressions was even when you were using Cppcheck 2.1, but you didn't see any errors.
I'm not sure about the format of rule files from your message. You need something like this:
I did some poking around, and it looks like the rules parser doesn't handle multi-line rules or rule text that starts with a special character . I'd been adding rules with multiple parts like this:
If I remove the parenthesis and make the rule a single line, like this:
The parser appears to work.
Regarding 'special characters', it appears that any non-alphanumeric character causes a rule to fail to parse, for example, the following will not be parsed:
Thank you for pointing me in the right direction!
Last edit: Mike Banducci 2021-08-17