Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Redundant Condition  at pmsg.c:1537

Categories: LANG.STRUCT.RC CWE:570 CWE:571
Warning ID: 226.28858
Similar Warnings: 226.28859
Procedure: enc_xdr_cplx
Trace: view
Modified: Thu Nov 26 11:28:16 2009   show details
 
Priority: None
State: None
Finding: None
Owner: None
  edit properties

Legend [ X ]
Warning Location
Contributes
Parse Error
Other Warning
Two or More Loop Iterations
On Execution Path
Comment
Macro
Preprocessor
Include
Keyword
Preprocessed Away

Source  |  Language: C Hide Legend     
ProblemLineSource
   /kat0/fletcher/SATE/2010/pvm3/src/pmsg.c
   Enter enc_xdr_cplx
 1525 enc_xdr_cplx(mp, vp, cnt, std, siz) 
 1526         struct pmsg *mp;
 1527         void *vp;
 1528         int cnt, std, siz;
 1529 {
 1530         register float *xp;
 1531         int cc = 0;
 1532  
 1533         std = std * 2 - 1;
 1534         for (xp = (float*)vp; cnt-- > 0; xp += std) {
 1535                 if (!xdr_float(&mp->m_xdr, xp)) {
 1536                         mp->m_frag->fr_rlink->fr_len = xdr_getpos(&mp->m_xdr);
Never True: cc != 01537                         if (cc = enc_xdr_step(mp))     /* Redundant Condition */
 1538                                 break;   /* Unreachable Control Flow (ID: 227.28861) */
 1539                         else 
 1540                                 if (!xdr_float(&mp->m_xdr, xp)) {
 1541                                         cc = PvmNoMem;
 1542                                         break;
 1543                                 }
 1544                 }
 1545                 xp++;
 1546                 if (!xdr_float(&mp->m_xdr, xp)) {
 1547                         mp->m_frag->fr_rlink->fr_len = xdr_getpos(&mp->m_xdr);
 1548                         if (cc = enc_xdr_step(mp))   /* Redundant Condition (ID: 226.28859) */
 1549                                 break;   /* Unreachable Control Flow (ID: 227.28860) */
 1550                         else 
 1551                                 if (!xdr_float(&mp->m_xdr, xp)) {
 1552                                         cc = PvmNoMem;
 1553                                         break;
 1554                                 }
 1555                 }
 1556         }
 1557         mp->m_frag->fr_rlink->fr_len = xdr_getpos(&mp->m_xdr);
 1558         return cc;
 1559 } 




Change Warning 226.28858 : Redundant Condition

Because they are very similar, this warning shares annotations with warning 226.28859.

Priority:
State:
Finding:
Owner:
Note: