Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Redundant Condition  at pmsg.c:1574

Categories: LANG.STRUCT.RC CWE:570 CWE:571
Warning ID: 2644.2687
Similar Warnings: 2644.2686
Procedure: enc_xdr_dcplx
Trace: View
Modified: Wed Sep 2 12:42:33 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
   /u1/paul/SATE/2010/c/pvm/pvm3/src/pmsg.c
   Enter enc_xdr_dcplx
 1563 enc_xdr_dcplx(mp, vp, cnt, std, siz) 
 1564         struct pmsg *mp;
 1565         void *vp;
 1566         int cnt, std, siz;
 1567 {
 1568         register double *zp;
 1569         int cc = 0;
 1570  
 1571         std = std * 2 - 1;
 1572         for (zp = (double*)vp; cnt-- > 0; zp += std) {
 1573                 if (!xdr_double(&mp->m_xdr, zp)) {
Never True: cc != 01574                         if (cc = enc_xdr_step(mp))     /* Redundant Condition */
 1575                                 break;   /* Unreachable Control Flow (ID: 2645.2688) */
 1576                         else 
 1577                                 if (!xdr_double(&mp->m_xdr, zp)) {
 1578                                         cc = PvmNoMem;
 1579                                         break;
 1580                                 }
 1581                 }
 1582                 mp->m_frag->fr_rlink->fr_len = xdr_getpos(&mp->m_xdr);
 1583                 zp++;
 1584                 if (!xdr_double(&mp->m_xdr, zp)) {
 1585                         if (cc = enc_xdr_step(mp))   /* Redundant Condition (ID: 2644.2686) */
 1586                                 break;   /* Unreachable Control Flow (ID: 2645.2689) */
 1587                         else 
 1588                                 if (!xdr_double(&mp->m_xdr, zp)) {
 1589                                         cc = PvmNoMem;
 1590                                         break;
 1591                                 }
 1592                 }
 1593                 mp->m_frag->fr_rlink->fr_len = xdr_getpos(&mp->m_xdr);
 1594         }
 1595         return cc;
 1596 




Change Warning 2644.2687 : Redundant Condition

Because they are very similar, this warning shares annotations with warning 2644.2686.
CodeSonar has selected warning 2644.2686 to represent this group of similar warnings. In order to edit this group, you must edit warning 2644.2686.