Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Useless Assignment  at trcfile.c:440

Categories: LANG.STRUCT.UA
Warning ID: 2858.2921
Procedure: trc_check_listsize
Trace: View
Modified: Wed Sep 2 12:50:34 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     
LineSource
  /u1/paul/SATE/2010/c/pvm/pvm3/tracer/trcfile.c
  Enter trc_check_listsize
413 trc_check_listsize( list, size, index ) 
414 void ***list;
415 int *size;
416 int index;
417 {
418         void **newlist;
419  
420         int newsize;
421         int i;
422  
423         if ( index >= *size )
424         {
425                 newsize = 2 * index;
426  
427                 newsize = newsize ? newsize : 100;
428  
429                 newlist = (void **) malloc( (unsigned) newsize 
430                         * sizeof(void *) );
431                 trc_memcheck( newlist, "New TRC_TEVDESC Index List);
432  
433                 for ( i=0 ; i < *size ; i++ )
434                 {
435                         newlist[i] = (*list)[i];
436  
437                         (*list)[i] = (void *) NULL;
438                 }
439  
440                 for ( i=( ((*size) >= 0) ? (*size) : 0 ) ; i < newsize ; i++ )     /* Useless Assignment */
441                         newlist[i] = (void *) NULL;
442  
443                 if ( *list )
444                         free( *list );
445  
446                 *list = newlist;
447                 *size = newsize;
448         }
449 




Change Warning 2858.2921 : Useless Assignment

Priority:
State:
Finding:
Owner:
Note: