mirror of
https://github.com/google/pebble.git
synced 2025-06-26 19:06:17 +00:00
Import of the watch repository from Pebble
This commit is contained in:
commit
3b92768480
10334 changed files with 2564465 additions and 0 deletions
43
tools/arc/linting/tintin.rule
Normal file
43
tools/arc/linting/tintin.rule
Normal file
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<rule version="1">
|
||||
<pattern>PBL_ASSERT_OOM</pattern>
|
||||
<message>
|
||||
<id>pbl_assert_oom</id>
|
||||
<severity>style</severity>
|
||||
<summary>PBL_ASSERT_OOM is a large macro. Consider using the *_malloc_check versions or checking for NULL instead.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<rule version="1">
|
||||
<pattern>snprintf</pattern>
|
||||
<message>
|
||||
<id>snprintf</id>
|
||||
<severity>style</severity>
|
||||
<summary>The function 'snprintf' uses up a lot of our precious stack space. A simpler set of strcpy/strcat functions might be a better approach. If it is not being used deep in the stack, continue on your merry way.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<rule version="1">
|
||||
<pattern>psleep</pattern>
|
||||
<message>
|
||||
<id>psleep</id>
|
||||
<severity>style</severity>
|
||||
<summary>The function 'psleep' can delay for less than the interval
|
||||
specified. In fact, psleep(1) can actually wind up taking no time at
|
||||
all. (Check out sleep.h if you don't believe me!) Also note, psleep(0) forces a reschedule but will starve low priority
|
||||
tasks if you do it in a while loop! So double check your delay and carry on!</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
<rule version="1">
|
||||
<pattern>\b(\w+_)?malloc(_check)?\b</pattern>
|
||||
<message>
|
||||
<id>malloc</id>
|
||||
<severity>style</severity>
|
||||
<summary>The function 'malloc' returns uninitialized memory while callers often (sometimes indirectly) assume that the allocated memory is filled with bytes of value zero. If in doubt, use `zalloc` instead. In most cases, the performance impact of this extra processing is negligible.</summary>
|
||||
</message>
|
||||
</rule>
|
||||
|
||||
|
||||
<!-- More can be added here -->
|
Loading…
Add table
Add a link
Reference in a new issue