Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Useless Assignment  at pvmfrag.c:171

Categories: LANG.STRUCT.UA
Warning ID: 2431.2458
Similar Warnings: 2431.2457
Procedure: fr_new
Trace: View
Modified: Wed Sep 2 12:39:28 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/src/pvmfrag.c
  Enter fr_new
161 struct frag * 
162 fr_new(len) 
163         int len;        /* (max) buffer size or 0 */ 
164 {
165         struct frag *fp;
166  
167         if (!(fp = frag_get_header()))
168                 goto oops;
169  
170         if (len) {      /* slave frag */ 
171                 fp->fr_link = fp->fr_rlink = 0;     /* Useless Assignment */
172                 if (!(fp->fr_dat = fp->fr_buf = da_new(len))) {
173                         frag_put_header(fp);
174                         goto oops;
175                 }
176                 fp->fr_max = len;
177  
178         } else {        /* master */ 
179                 fp->fr_link = fp->fr_rlink = fp;
180                 fp->fr_dat = fp->fr_buf = 0;
181                 fp->fr_max = 0;
182         }
183         fp->fr_len = 0;
184         fp->fr_u.ref = 1;
185         fp->fr_u.dab = 1;
186         fp->fr_u.spr = 0;
187         fp->fr_rip = 0;
188 #ifdef IMA_CSPP 
189         fp->fr_num_unpacked = 0; 
190 #endif 
191 /*
192         pvmlogprintf("fr_new() %d = %lx\n", len, fp);
193 */ 
194         return fp;
195  
196 oops
197         pvmlogerror("fr_new() can't get memory\n");
198         pvmbailout(0);
199         return (struct frag*)0;   /* Unreachable Computation (ID: 2432.2459) */
200 




Change Warning 2431.2458 : Useless Assignment

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