[RTEMS Project] #3946: capture-support: Dead Code (CID #1461469 \)

RTEMS trac trac at rtems.org
Fri Apr 10 15:34:17 UTC 2020


#3946: capture-support: Dead Code (CID #1461469 \)
---------------------------+--------------------------
 Reporter:  Joel Sherrill  |       Owner:  Chris Johns
     Type:  defect         |      Status:  assigned
 Priority:  normal         |   Milestone:  5.1
Component:  lib            |     Version:  5
 Severity:  normal         |  Resolution:
 Keywords:  coverity       |  Blocked By:
 Blocking:                 |
---------------------------+--------------------------
Changes (by Joel Sherrill):

 * keywords:   => coverity


Old description:

> New report from Coverity. git blame says Chris.
>
> {{{
> 316      /* Find the next record to print, the earliest recond on any
> core */
>         const: At condition this_time == 0ULL, the value of this_time
> must be equal to 0.
>         dead_error_condition: The condition this_time == 0ULL must be
> true.
>
> CID 1461469 (#1 of 1): Logically dead code (DEADCODE)
> dead_error_line: Execution cannot reach the expression cpu->rec.time <
> this_time inside this statement: if (cpu->rec_valid && (this....
> 317      if ((cpu->rec_valid) && ((this_time == 0) || (cpu->rec.time <
> this_time)))
> 318      {
> 319        rec_out = &cpu->rec;
> 320        cpu_out = i;
> 321        this_time = rec_out->time;
> 322      }
> }}}

New description:

 New report from Coverity. git blame says Chris.

 {{{
 *** CID 1461469:  Control flow issues  (DEADCODE)
 /home/joel/rtems-work/rtems/cpukit/libmisc/capture/capture_support.c: 317
 in rtems_capture_print_trace_records()
 311                                                       &cpu->rec,
 312                                                       sizeof
 (cpu->rec));
 313             cpu->rec_valid = true;
 314           }
 315
 316           /* Find the next record to print, the earliest recond on any
 core */
 >>>     CID 1461469:  Control flow issues  (DEADCODE)
 >>>     Execution cannot reach the expression "cpu->rec.time < this_time"
 inside this statement: "if (cpu->rec_valid && (this...".
 317           if ((cpu->rec_valid) && ((this_time == 0) || (cpu->rec.time
 < this_time)))
 318           {
 319             rec_out = &cpu->rec;
 320             cpu_out = i;
 321             this_time = rec_out->time;
 322           }}}}

--

--
Ticket URL: <http://devel.rtems.org/ticket/3946#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list