Patchwork [Fortran,committed] Init a variable

login
register
mail settings
Submitter Tobias Burnus
Date April 15, 2013, 12:45 p.m.
Message ID <516BF675.9000505@net-b.de>
Download mbox | patch
Permalink /patch/236586/
State New
Headers show

Comments

Tobias Burnus - April 15, 2013, 12:45 p.m.
Found with the Coverity scanner. It also complains about the 
fall-throughs. Either the comment will silence the warning* or at least 
it helps human reviewers.

Committed as Rev. 197969 after build+regtesting on x86-64-gnu-linux.

Tobias

(* Well, one can also silence the Coverity diagnostic for that spot.)

Patch

2013-04-15  Tobias Burnus  <burnus@net-b.de>

	* list_read.c (finish_separator): Initialize variable.

diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index b29fdcd..c8a1bdfc 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -393,7 +393,7 @@  static int
 finish_separator (st_parameter_dt *dtp)
 {
   int c;
-  int err;
+  int err = LIBERROR_OK;
 
  restart:
   eat_spaces (dtp);
@@ -433,7 +433,7 @@  finish_separator (st_parameter_dt *dtp)
 	    return err;
 	  goto restart;
 	}
-
+      /* Fall through.  */
     default:
       unget_char (dtp, c);
       break;
@@ -2788,6 +2788,7 @@  nml_get_obj_data (st_parameter_dt *dtp, namelist_info **pprev_nl,
 		    "namelist not terminated with / or &end");
 	  goto nml_err_ret;
 	}
+      /* Fall through.  */
     case '/':
       dtp->u.p.input_complete = 1;
       return true;