Text  |   XML   |   Visible Warnings:

pvm3.4.6 : pvm3.4.6 analysis 2 : Ignored Return Value  at trccompat.c:918

Categories: LANG.FUNCS.IRV CWE:252 CWE:253 POW10:7
Warning ID: 572.29371
Procedure: trc_old_pvm_event_string
Trace: view
Modified: Thu Nov 26 11:39: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
  /kat0/fletcher/SATE/2010/pvm3/tracer/trccompat.c
  Enter trc_old_pvm_event_string
817 char * 
818 trc_old_pvm_event_string( ID, eid ) 
819 TRC_ID ID;
820 int eid;
821 {
822         char result[4096];
823         char tmp[2048];
824         char buf[1024];
825  
826         char *fmt;
827         char *str;
828  
829         int keeplist[10];
830  
831         int vecflag;
832         int veclen;
833         int index;
834         int nkeep;
835         int keep;
836         int ival;
837         int sep;
838  
839         fmt = trc_old_tev_formats[ eid ].fmt;
840  
841         if ( fmt != NULL )
842         {
843                 nkeep = 0;
844  
845                 if ( *fmt != '=' )
846                         sprintf( result, "%s", trc_old_tev_formats[ eid ].name );
847  
848                 else 
849                         sprintf( result, "%s() ", trc_old_tev_formats[ eid ].name );
850          
851                 while ( *fmt )
852                 {
853                         if ( *fmt == '%' )
854                         {
855                                 fmt++;
856  
857                                 if ( *fmt == '*' )
858                                 {
859                                         keep = TRC_TRUE;
860  
861                                         fmt++;
862                                 }
863  
864                                 else 
865                                         keep = TRC_FALSE;
866  
867                                 if ( *fmt == '$' )
868                                 {
869                                         fmt++;
870  
871                                         index = *fmt - '0';
872  
873                                         fmt++;
874  
875                                         veclen = ( index >= 0 && index < nkeep ) 
876                                                 ? keeplist[index] : 0;
877  
878                                         vecflag = TRC_TRUE;
879  
880                                         sep = TRC_FALSE;
881                                 }
882  
883                                 else 
884                                 {
885                                         veclen = 1;
886  
887                                         vecflag = TRC_FALSE;
888                                 }
889  
890                                 while ( veclen > 0 )
891                                 {
892                                         veclen--;
893  
894                                         if ( vecflag )
895                                         {
896                                                 if ( sep )
897                                                         trc_append_str( result, " ", 4096 );
898  
899                                                 sep = TRC_TRUE;
900                                         }
901  
902                                         switch ( *fmt ) 
903                                         {
904                                                 case 'd': 
905                                                 {
906                                                         fscanf( ID->trace_in, ", %d", &ival );
907                  
908                                                         sprintf( tmp, " %d", ival );   /* Uninitialized Variable (ID: 476.29241) */
909                  
910                                                         trc_append_str( result, tmp, 4096 );
911          
912                                                         break;
913                                                 }
914                  
915                                                 /* decimal result code */ 
916                                                 case 'R': 
917                                                 {
918                                                         fscanf( ID->trace_in, ", %d", &ival );     /* Ignored Return Value */
919                  
920                                                         sprintf( tmp, " %d", ival );   /* Uninitialized Variable (ID: 476.29244) */
921          
922                                                         trc_append_str( result, tmp, 4096 );
923          
924                                                         if ( ival < 0 )
925                                                         {
926                                                                 if ( ival <= 0 
927                                                                         && ival > -trc_old_pvm_nerr )
928                                                                 {
929                                                                         sprintf( tmp, " (%s)",
930                                                                                 trc_old_pvm_errlist[ -ival ] );
931                                                                 }
932                                                                  
933                                                                 else 
934                                                                 {
935                                                                         sprintf( tmp, " %d (Unknown Error)",
936                                                                                 ival );
937                                                                 }
938          
939                                                                 trc_append_str( result, tmp, 4096 );
940                                                         }
941                  
942                                                         break;
943                                                 }
944                  
945                                                 /* hex result code / decimal if negative */ 
946                                                 case 'r': 
947                                                 {
948                                                         fscanf( ID->trace_in, ", %d", &ival );
949                  
950                                                         if ( ival < 0 )   /* Uninitialized Variable (ID: 478.29243) */
951                                                         {
952                                                                 if ( ival <= 0 
953                                                                         && ival > -trc_old_pvm_nerr )
954                                                                 {
955                                                                         sprintf( tmp, " %d (%s)", ival,
956                                                                                 trc_old_pvm_errlist[ -ival ] );
957                                                                 }
958          
959                                                                 else 
960                                                                 {
961                                                                         sprintf( tmp, " %d (Unknown Error)",
962                                                                                 ival );
963                                                                 }
964                                                         }
965                                                          
966                                                         else 
967                                                                 sprintf( tmp, " 0x%x", ival );
968                  
969                                                         trc_append_str( result, tmp, 4096 );
970          
971                                                         break;
972                                                 }
973                  
974                                                 case 'x': 
975                                                 {
976                                                         fscanf( ID->trace_in, ", %d", &ival );
977                  
978                                                         sprintf( tmp, " 0x%x", ival );   /* Uninitialized Variable (ID: 477.29242) */
979                  
980                                                         trc_append_str( result, tmp, 4096 );
981                  
982                                                         break;
983                                                 }
984                  
985                                                 case 'S': 
986                                                 {
987                                                         trc_read_old_trace_str( ID,
988                                                                 buf, 1024, TRC_TRUE );
989                  
990                                                         sprintf( tmp, " \"%s\"", buf );
991                  
992                                                         trc_append_str( result, tmp, 4096 );
993                  
994                                                         break;
995                                                 }
996                  
997                                                 default: 
998                                                 {
999                                                         sprintf( tmp, "%%%c", *fmt );
1000                  
1001                                                         trc_append_str( result, tmp, 4096 );
1002          
1003                                                         break;
1004                                                 }
1005                                         }
1006                                 }
1007          
1008                                 if ( *fmt )
1009                                         fmt++;
1010                                  
1011                                 if ( keep )
1012                                 {
1013                                         keeplist[nkeep] = ival < 0 ? 0 : ival;   /* Uninitialized Variable (ID: 475.29245) */
1014  
1015                                         nkeep++;
1016                                 }
1017                         }
1018                          
1019                         else 
1020                         {
1021                                 sprintf( tmp, "%c", *fmt++ );
1022  
1023                                 trc_append_str( result, tmp, 4096 );
1024                         }
1025                 }
1026         }
1027  
1028         else 
1029                 sprintf( result, "%s()", trc_old_tev_formats[ eid ].name );
1030  
1031         trc_find_event_end( ID );
1032  
1033         str = trc_copy_str( result );
1034  
1035         return( str );
1036 } 




Change Warning 572.29371 : Ignored Return Value

Priority:
State:
Finding:
Owner:
Note: