Text  |   XML   |   Visible Warnings:

Pvm : Pvm analysis 1 : Missing Return Statement  at pvm_gstat.c:111

Categories: LANG.STRUCT.MRS
Warning ID: 2949.3032
Similar Warnings: 2949.3050
Procedure: main
Trace: View
Modified: Wed Sep 2 12:55:13 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/pvmgs/pvm_gstat.c
   Enter main
 51 main(argc, argv) 
 52 int argc;
 53 char *argv[];
 54 {
 55     int gstid;
 56     int i, j, ng;  
 57     GROUP_STRUCT group;
 58         group.len = 0; group.name = (char *) NULL;
 59         group.tids = (int *) NULL; group.btids = (int *) NULL;
 60         pvm_mytid();
 61         if((gstid = gs_getgstid()) < 0)  
 62         {
 63             fprintf(stderr, "%s: no groups server\n", argv[0]);
 64             return(-1);
 65         }
 66         pvm_setcontext( SYSCTX_DG );
 67         pvm_initsend(PvmDataDefault);
 68         pvm_send(gstid, GSLS);
 69         if ( pvm_trecv(gstid, GSLS, pvmgs_tmout) <= 0)  
 70         {
 71              fprintf(stderr, "Error receiving message from group server\n");
 72              exit (-1);
 73         }
 74        
 75         /* Unpack the information for each group                           */ 
 76         pvm_upkint(&ng, 1, 1);
 77         if (ng == 0)   /* Uninitialized Variable (ID: 2953.3036) */
 78             fprintf(stdout, "no groups exist\n");
 79         for (i = 0; i < ng; i++)  
 80         {
 81             pvm_upkint(&(group.len),1,1);
 82             NEWMEM(group.name, group.len+1,char);
 83             pvm_upkstr(group.name);
 84             pvm_upkint(&(group.ntids), 1, 1);
 85             pvm_upkint(&(group.maxntids), 1,1);
 86             pvm_upkint(&(group.barrier_count), 1, 1);
 87             pvm_upkint(&(group.barrier_reached),1,1);
 88             NEWMEM(group.tids, group.maxntids, int);
 89             NEWMEM(group.btids, group.barrier_reached, int);
 90             pvm_upkint(group.tids, group.maxntids, 1);
 91             if (group.barrier_reached > 0)
 92                 pvm_upkint(group.btids, group.barrier_reached, 1);
 93             fprintf(stdout,  
 94                 "group: %s, size: %d,  barrier_count %d, barrier_reached %d\n",
 95                  group.name, group.ntids, group.barrier_count,  
 96                  group.barrier_reached);
 97             fputs("tids:\n", stdout);
 98             for (j = 0; j < group.maxntids; j++)
 99                 if (group.tids[j] > 0)   /* Uninitialized Variable (ID: 2951.3034) */  /* Null Pointer Dereference (ID: 2952.3035) */
 100                     fprintf(stdout, "%d 0x%x\t", j, group.tids[j]);
 101             fputs("\n", stdout);
 102             if (group.barrier_reached > 0)  
 103             {
 104                 fputs("tids waiting on barrier:\n", stdout);
 105                 for (j = 0; j < group.barrier_reached; j++)
 106                      fprintf(stdout, "0x%x\t", group.btids[j]);   /* Uninitialized Variable (ID: 2950.3033) */
 107                 fputs("\n", stdout);
 108             }
 109         }
 110         pvm_exit();
true111 }     /* Missing Return Statement */
Preconditions
&$unknown_3690107 >= 2
pvmmytid >= -1
pvmtoplvl != 0




Change Warning 2949.3032 : Missing Return Statement

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

Priority:
State:
Finding:
Owner:
Note: