pebble/tools/arc/linting/tintin.rule

44 lines
1.6 KiB
Text
Raw Permalink Normal View History

<?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 -->