mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update coverity example README (#1020)
* Update coverity example README * Update main.c for comment --------- Co-authored-by: Ubuntu <ubuntu@ip-172-31-34-245.ap-northeast-1.compute.internal>
This commit is contained in:
parent
52ee9faa72
commit
ccbbf04e5b
|
@ -43,7 +43,13 @@
|
||||||
/* Standard includes. */
|
/* Standard includes. */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void exampleTask( void * parameters )
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void exampleTask( void * parameters );
|
||||||
|
|
||||||
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void exampleTask( void * parameters )
|
||||||
{
|
{
|
||||||
/* Unused parameters. */
|
/* Unused parameters. */
|
||||||
( void ) parameters;
|
( void ) parameters;
|
||||||
|
@ -61,13 +67,13 @@ void main( void )
|
||||||
static StaticTask_t exampleTaskTCB;
|
static StaticTask_t exampleTaskTCB;
|
||||||
static StackType_t exampleTaskStack[ configMINIMAL_STACK_SIZE ];
|
static StackType_t exampleTaskStack[ configMINIMAL_STACK_SIZE ];
|
||||||
|
|
||||||
printf( "Example FreeRTOS Project\n" );
|
( void ) printf( "Example FreeRTOS Project\n" );
|
||||||
|
|
||||||
xTaskCreateStatic( exampleTask,
|
( void ) xTaskCreateStatic( exampleTask,
|
||||||
"example",
|
"example",
|
||||||
configMINIMAL_STACK_SIZE,
|
configMINIMAL_STACK_SIZE,
|
||||||
NULL,
|
NULL,
|
||||||
configMAX_PRIORITIES - 1,
|
configMAX_PRIORITIES - 1U,
|
||||||
&( exampleTaskStack[ 0 ] ),
|
&( exampleTaskStack[ 0 ] ),
|
||||||
&( exampleTaskTCB ) );
|
&( exampleTaskTCB ) );
|
||||||
|
|
||||||
|
@ -81,12 +87,16 @@ void main( void )
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
#if ( configCHECK_FOR_STACK_OVERFLOW > 0 )
|
||||||
|
|
||||||
|
void vApplicationStackOverflowHook( TaskHandle_t xTask,
|
||||||
char * pcTaskName )
|
char * pcTaskName )
|
||||||
{
|
{
|
||||||
/* Check pcTaskName for the name of the offending task,
|
/* Check pcTaskName for the name of the offending task,
|
||||||
* or pxCurrentTCB if pcTaskName has itself been corrupted. */
|
* or pxCurrentTCB if pcTaskName has itself been corrupted. */
|
||||||
( void ) xTask;
|
( void ) xTask;
|
||||||
( void ) pcTaskName;
|
( void ) pcTaskName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif /* #if ( configCHECK_FOR_STACK_OVERFLOW > 0 ) */
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
|
@ -4,7 +4,7 @@ run [Synopsys Coverity](https://www.synopsys.com/software-integrity/security-tes
|
||||||
for checking MISRA compliance.
|
for checking MISRA compliance.
|
||||||
|
|
||||||
> **Note**
|
> **Note**
|
||||||
Coverity version 2022.6.1 incorrectly infers the type of `pdTRUE` and `pdFALSE`
|
Coverity version 2023.6.1 incorrectly infers the type of `pdTRUE` and `pdFALSE`
|
||||||
as boolean because of their names, resulting in multiple false positive warnings
|
as boolean because of their names, resulting in multiple false positive warnings
|
||||||
about type mismatch. We replace `pdTRUE` with `pdPASS` and `pdFALSE` with
|
about type mismatch. We replace `pdTRUE` with `pdPASS` and `pdFALSE` with
|
||||||
`pdFAIL` to avoid these false positive warnings. This workaround will not be
|
`pdFAIL` to avoid these false positive warnings. This workaround will not be
|
||||||
|
@ -40,15 +40,14 @@ commands in a terminal:
|
||||||
3. Build the (pseudo) application:
|
3. Build the (pseudo) application:
|
||||||
~~~
|
~~~
|
||||||
cd build/
|
cd build/
|
||||||
cov-build --emit-complementary-info --dir cov-out make
|
cov-build --emit-complementary-info --dir cov-out make coverity
|
||||||
~~~
|
~~~
|
||||||
4. Go to the Coverity output directory (`cov-out`) and begin Coverity static
|
4. Go to the Coverity output directory (`cov-out`) and begin Coverity static
|
||||||
analysis:
|
analysis:
|
||||||
~~~
|
~~~
|
||||||
cd cov-out/
|
|
||||||
cov-analyze --dir ./cov-out \
|
cov-analyze --dir ./cov-out \
|
||||||
--coding-standard-config ../examples/coverity/coverity_misra.config \
|
--coding-standard-config ../examples/coverity/coverity_misra.config \
|
||||||
--tu-pattern "file('.*/FreeRTOS/Source/[A-Za-z_]*\.c')
|
--tu-pattern "file('[A-Za-z_]+\.c')"
|
||||||
~~~
|
~~~
|
||||||
5. Generate the HTML report:
|
5. Generate the HTML report:
|
||||||
~~~
|
~~~
|
||||||
|
|
Loading…
Reference in a new issue