Added rule files based on rules suggested by jglathe
This commit is contained in:
parent
17cf24ed34
commit
57ebed20c4
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<rule version="1">
|
||||||
|
<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>
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<rule version="1">
|
||||||
|
<pattern> [;{}] [*] \w+? (\+\+|\-\-) ; </pattern>
|
||||||
|
<message>
|
||||||
|
<id>UnusedDeref</id>
|
||||||
|
<severity>style</severity>
|
||||||
|
<summary>Redundant * found, "*p++" is the same as "*(p++)".</summary>
|
||||||
|
</message>
|
||||||
|
</rule>
|
Loading…
Reference in New Issue