Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
9fee0fe4
Commit
9fee0fe4
authored
Sep 12, 2018
by
Paul
Browse files
Add some rules for confusing deref operators
parent
7b79ccf3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
cppcheck.rules
cppcheck.rules
+24
-0
No files found.
cppcheck.rules
View file @
9fee0fe4
<?xml version="1.0"?>
<?xml version="1.0"?>
<rule>
<pattern>
[;{}] [*] \w+? (\+\+|\-\-) ;
</pattern>
<message>
<id>
UnusedDeref
</id>
<severity>
style
</severity>
<summary>
Redundant * found, "*p++" is the same as "*(p++)".
</summary>
</message>
</rule>
<rule>
<pattern>
if \( ([!] )*?(strlen) \( \w+? \) ([>] [0] )*?\) {
</pattern>
<message>
<id>
StrlenEmptyString
</id>
<severity>
performance
</severity>
<summary>
Using strlen() to check if a string is empty is not efficient.
</summary>
</message>
</rule>
<rule>
<pattern>
[;{}] [*] \w+? (\+\+|\-\-) ;
</pattern>
<message>
<id>
UnusedDeref
</id>
<severity>
style
</severity>
<summary>
Redundant * found, "*p++" is the same as "*(p++)".
</summary>
</message>
</rule>
<rule>
<rule>
<tokenlist>
define
</tokenlist>
<tokenlist>
define
</tokenlist>
<pattern>
define [0-9A-Z_^a-z]*[a-z]
</pattern>
<pattern>
define [0-9A-Z_^a-z]*[a-z]
</pattern>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment