[RTEMS Project] #2405: CppCheck errors being reported throughout the code

RTEMS trac trac at rtems.org
Tue Sep 1 19:09:07 UTC 2015


#2405: CppCheck errors being reported throughout the code
---------------------------+--------------------
 Reporter:  martin.galvan  |      Owner:
     Type:  defect         |     Status:  new
 Priority:  normal         |  Milestone:  4.11.1
Component:  General        |    Version:  4.11
 Severity:  normal         |   Keywords:
---------------------------+--------------------
 I performed a run of {{{cppcheck --enable-all}}} on the git master and the
 following items were reported as 'error':

 {{{
 [c/src/lib/libbsp/shared/umon/umon.h:21]: (error) Invalid number of
 character ({) when these macros are defined: '__cplusplus'.
 [cpukit/libmisc/dumpbuf/dumpbuf.c:69]: (error) Undefined behavior:
 Variable 'line_buffer' is used as parameter and destination in
 s[n]printf().
 [cpukit/libmisc/dumpbuf/dumpbuf.c:76]: (error) Undefined behavior:
 Variable 'line_buffer' is used as parameter and destination in
 s[n]printf().
 [cpukit/libnetworking/rtems/rtems_dhcp.c:401]: (error) Common realloc
 mistake: 'dhcp_hostname' nulled but not freed upon failure
 [cpukit/posix/include/rtems/posix/ptimer.h:33]: (error) Invalid number of
 character ({) when these macros are defined: '__cplusplus'.
 [cpukit/rtems/include/rtems/rtems/dpmemimpl.h:104]: (error) Invalid number
 of character ({) when these macros are defined: '__cplusplus'.
 [tools/cpu/nios2/memory.c:99]: (error) Uninitialized variable: memory
 [tools/cpu/nios2/ptf.c:582]: (error) Memory leak: new_prefix
 }}}

 Notice I ran cppcheck mostly on the modules I'm currently using (that
 means most BSPs weren't checked). Some other errors may show up when
 running it on the entire source.

--
Ticket URL: <http://devel.rtems.org/ticket/2405>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list