Opened on 11/03/18 at 04:12:59
Closed on 11/22/18 at 15:59:41
#3581 closed defect (fixed)
Structurally dead code in fifo.c (CID 1437649 )
Reported by: | shashvat jain | Owned by: | Joel Sherrill <joel@…> |
---|---|---|---|
Priority: | normal | Milestone: | Indefinite |
Component: | lib/block | Version: | 6 |
Severity: | normal | Keywords: | Coverity |
Cc: | Blocked By: | ||
Blocking: |
Description
As per coverity scan at https://scan.coverity.com/projects/rtems ,CID 1437649 , line 103 in fifo.c is unreachable and the code is called to be structurally dead. You will need an Coverity Scan account and permission to view RTEMS to see more details.
all the "goto" statements are present , the problem could have arised due to
syntax issue like "indentation" or due to a problem in upstream files.the code in question is:
100 c = 'a';
101 return 0;
102
CID 1437649 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: rtems_barrier_delete(pipe->....
103 rtems_barrier_delete(pipe->writeBarrier);
104err_wbar:
105 rtems_barrier_delete(pipe->readBarrier);
106err_rbar:
107 free(pipe->Buffer);
108err_buf:
109 free(pipe);
110 return err;
111}
Change History (2)
comment:1 Changed on 11/03/18 at 15:20:28 by Joel Sherrill
comment:2 Changed on 11/22/18 at 15:59:41 by Joel Sherrill <joel@…>
Owner: | set to Joel Sherrill <joel@…> |
---|---|
Resolution: | → fixed |
Status: | new → closed |
In [changeset:"9dfb9a9879cd82f47604dfc007533f62b99bb392/rtems" 9dfb9a98/rtems]:
Line 103 does indeed appear to be dead. It is in between a return 0 and a label. There is no way to get there.