fxysunshine commented on code in PR #18282:
URL: https://github.com/apache/nuttx/pull/18282#discussion_r2759237907
##########
libs/libc/misc/lib_crc16ccitt.c:
##########
@@ -99,10 +61,45 @@ uint16_t crc16ccittpart(FAR const uint8_t *src, size_t len,
{
size_t i;
uint16_t v = crc16val;
+ static const uint16_t g_crc16_tab[256] =
Review Comment:
> 1. Moving the scope of the static definition violates the NuttX coding
standards, especially since your modification still retains the **Private
Data** section.
> 2. Some OS certified to ASIL-D do not follow this rule either. If there
were no mandatory ASIL-D requirements, I think we could relax such restrictions.
>
>
https://atomgit.com/easyxmen/XMen/blob/master/RTOS/Kernel/src/Os_Interrupt.c#L41-L60
https://github.com/seL4/seL4/blob/master/src/kernel/boot.c#L24
The two examples you gave do not fit this rule. Scope moving only occurs
when a static global variable is used in the only function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]