[PATCH 00/20] CodeSonar Clean Up Patches

Joel Sherrill joel.sherrill at oarcorp.com
Tue Nov 25 23:02:28 UTC 2014


Hi

Josh O'guin and I have been using CodeSonar to evaluate RTEMS.
This is a first set of patches which clears up some of the reported
issues.  

Most of the patches are small. However, the tools/ directory
is a single patch for all files. They are not compiled with 
warnings and ignored by Coverity Scan. This means that they
have never been examined with any rigor and there were a lot
of issues to address.

Hopefully none of these will be too controversial.

--joel and josh


Josh Oguin (20):
  apimutex.c: Add _Assert for NULL pointer access
  libbsp/shared/bspinit.c: Document assumption of NULL returned
  libchip/display/disp_hcms29xx.c: Remove useless variable and check
  libchip/serial/ns16550* and z8530*: Assert on baud number to avoid
    divide by 0
  libchip/serial/z85c30.c: Remove redundant assignment
  libcsupport/src/mount.c: Remove unnecessary operation
  libcsupport/src/newlibc_exit.c: Remove dead code
  libcsupport/src/sync.c: Indicate return value explicitly ignored
  dosfs/msdos_conv.c: Remove unnecessary operations
  dosfs/msdos_file.c: Return an error if it occurs
  dosfs/msdos_misc.c: Remove unnecessary operation
  imfs/imfs_handlers_link.c: Add _Assert for NULL pointer
  monitor/mon-editor.c: Use puts() and snprintf() not fprintf() or
    sprintf()
  cpukit/posix/src/timertsr.c: Add _Assert()
  chainimpl.h: Add _Assert() to _Chain_Initialize_empty()
  objectimpl.h: Add _Assert() to _Objects_Invalidate_Id()
  objectgetnameasstring.c: Reformat _Objects_Get() switch to follow
    pattern
  monitor/mon-prmisc.c: Use puts() not fprintf()
  libcsupport/src/sync.c: Explicitly ignore return status
  tools/build/*.c: Clean up issues reported by CodeSonar

 c/src/lib/libbsp/shared/bspinit.c             |  24 +--
 c/src/libchip/display/disp_hcms29xx.c         |   7 +-
 c/src/libchip/serial/ns16550-context.c        |   4 +
 c/src/libchip/serial/ns16550.c                |   3 +
 c/src/libchip/serial/z85c30.c                 |   9 +-
 cpukit/libcsupport/src/mount.c                |   1 -
 cpukit/libcsupport/src/newlibc_exit.c         |   2 +-
 cpukit/libcsupport/src/sync.c                 |   8 +-
 cpukit/libfs/src/dosfs/msdos_conv.c           |   5 +-
 cpukit/libfs/src/dosfs/msdos_file.c           |   5 +-
 cpukit/libfs/src/dosfs/msdos_misc.c           |   2 +-
 cpukit/libfs/src/imfs/imfs_handlers_link.c    |   2 +
 cpukit/libmisc/monitor/mon-editor.c           |  12 +-
 cpukit/libmisc/monitor/mon-prmisc.c           |   2 +-
 cpukit/posix/src/timertsr.c                   |   9 +-
 cpukit/score/include/rtems/score/chainimpl.h  |  12 +-
 cpukit/score/include/rtems/score/objectimpl.h |   6 +
 cpukit/score/src/apimutex.c                   |   2 +
 cpukit/score/src/objectgetnameasstring.c      |  15 +-
 tools/build/binpatch.c                        | 144 ++++++++--------
 tools/build/cklength.c                        |  28 ++--
 tools/build/eolstrip.c                        |  14 +-
 tools/build/rtems-bin2c.c                     | 233 ++++++++++++++------------
 tools/build/unhex.c                           | 196 +++++++++++-----------
 24 files changed, 392 insertions(+), 353 deletions(-)

-- 
1.9.3




More information about the devel mailing list