nasa / PSP

The Core Flight System (cFS) Platform Support Package (PSP)
Apache License 2.0
67 stars 57 forks source link

PSP cppcheck warning stricter flag #117

Closed avan989 closed 4 years ago

avan989 commented 4 years ago

Is your feature request related to a problem? Please describe. [psp/fsw/mcp750-vxworks/src/cfe_psp_exception.c:90] -> [psp/fsw/mcp750-vxworks/src/cfe_psp_exception.c:136]: (style, inconclusive) Function 'CFE_PSP_ExceptionHook' argument 3 names different: declaration 'pEsf' definition 'vpEsf'. [psp/fsw/pc-linux/src/cfe_psp_memory.c:679] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:680]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-linux/src/cfe_psp_memory.c:680] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:681]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-linux/src/cfe_psp_memory.c:681] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:682]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-linux/src/cfe_psp_memory.c:686] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:687]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-linux/src/cfe_psp_memory.c:687] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:688]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-linux/src/cfe_psp_memory.c:688] -> [psp/fsw/pc-linux/src/cfe_psp_memory.c:689]: (style) Variable 'return_code' is reassigned a value before the old one has been used. [psp/fsw/pc-rtems/src/cfe_psp_exception.c:138]: (warning, inconclusive) The buffer 'TaskName' may not be null-terminated after the call to strncpy(). [psp/fsw/modules/eeprom_mmap_file/cfe_psp_eeprom_mmap_file.c:191]: (style) Variable 'Status' is assigned a value that is never used. [psp/fsw/shared/cfe_psp_module.h:106] -> [psp/fsw/shared/cfe_psp_module.c:111]: (style, inconclusive) Function 'CFE_PSP_Module_FindByName' argument 1 names different: declaration 'ModuleName' definition 'DriverName'. [psp/fsw/mcp750-vxworks/src/bsp-integration/cfeSupport.c:192]: (style) The scope of the variable 'i' can be reduced. [psp/fsw/mcp750-vxworks/src/bsp-integration/cfeSupport.c:193]: (style) The scope of the variable 'cfNameFound' can be reduced. [psp/fsw/mcp750-vxworks/src/bsp-integration/cfeSupport.c:194]: (style) The scope of the variable 'tempFd' can be reduced. [psp/fsw/mcp750-vxworks/src/bsp-integration/cfeSupport.c:195]: (style) The scope of the variable 'CompactFlashName' can be reduced. [psp/fsw/shared/cfe_psp_module.c:57]: (style) The scope of the variable 'ApiPtr' can be reduced.

Describe the solution you'd like Resolve warning

Requester Info Anh Van, NASA Goddard

skliper commented 4 years ago

For the scope ones, our coding standard actually specifies defines at the top of the function. Could you just suppress that warning on the command line? If you made any changes to reduce scope please back those out.