OSDN Git Service

2010-06-10 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Jun 2010 08:06:08 +0000 (08:06 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 10 Jun 2010 08:06:08 +0000 (08:06 +0000)
* error.c (error_print): Pre-initialize loc by NULL.
* openmp.c (resolve_omp_clauses): Add explicit
braces to avoid ambigous else.
* array.c (match_subscript): Pre-initialize m to MATCH_ERROR.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160525 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/array.c
gcc/fortran/error.c
gcc/fortran/openmp.c

index b7c1ecd..ae54bc5 100644 (file)
@@ -1,3 +1,10 @@
+2010-06-10  Kai Tietz  <kai.tietz@onevision.com>
+
+       * error.c (error_print): Pre-initialize loc by NULL.
+       * openmp.c (resolve_omp_clauses): Add explicit
+       braces to avoid ambigous else.
+       * array.c (match_subscript): Pre-initialize m to MATCH_ERROR.
+
 2010-06-10  Gerald Pfeifer  <gerald@pfeifer.com>
 
        * gfc-internals.texi: Move to GFDL 1.3.
index 3ffc397..64816f2 100644 (file)
@@ -64,7 +64,7 @@ gfc_copy_array_ref (gfc_array_ref *src)
 static match
 match_subscript (gfc_array_ref *ar, int init, bool match_star)
 {
-  match m;
+  match m = MATCH_ERROR;
   bool star = false;
   int i;
 
index b05e669..3092828 100644 (file)
@@ -471,7 +471,7 @@ error_print (const char *type, const char *format0, va_list argp)
   locus *l1, *l2, *loc;
   const char *format;
 
-  l1 = l2 = NULL;
+  loc = l1 = l2 = NULL;
 
   have_l1 = 0;
   pos = -1;
index 6a56515..0e25bf4 100644 (file)
@@ -845,11 +845,13 @@ resolve_omp_clauses (gfc_code *code)
   for (list = 0; list < OMP_LIST_NUM; list++)
     if (list != OMP_LIST_FIRSTPRIVATE && list != OMP_LIST_LASTPRIVATE)
       for (n = omp_clauses->lists[list]; n; n = n->next)
-       if (n->sym->mark)
-         gfc_error ("Symbol '%s' present on multiple clauses at %L",
-                    n->sym->name, &code->loc);
-       else
-         n->sym->mark = 1;
+       {
+         if (n->sym->mark)
+           gfc_error ("Symbol '%s' present on multiple clauses at %L",
+                      n->sym->name, &code->loc);
+         else
+           n->sym->mark = 1;
+       }
 
   gcc_assert (OMP_LIST_LASTPRIVATE == OMP_LIST_FIRSTPRIVATE + 1);
   for (list = OMP_LIST_FIRSTPRIVATE; list <= OMP_LIST_LASTPRIVATE; list++)
@@ -862,22 +864,24 @@ resolve_omp_clauses (gfc_code *code)
        }
 
   for (n = omp_clauses->lists[OMP_LIST_FIRSTPRIVATE]; n; n = n->next)
-    if (n->sym->mark)
-      gfc_error ("Symbol '%s' present on multiple clauses at %L",
-                n->sym->name, &code->loc);
-    else
-      n->sym->mark = 1;
-
+    {
+      if (n->sym->mark)
+       gfc_error ("Symbol '%s' present on multiple clauses at %L",
+                  n->sym->name, &code->loc);
+      else
+       n->sym->mark = 1;
+    }
   for (n = omp_clauses->lists[OMP_LIST_LASTPRIVATE]; n; n = n->next)
     n->sym->mark = 0;
 
   for (n = omp_clauses->lists[OMP_LIST_LASTPRIVATE]; n; n = n->next)
-    if (n->sym->mark)
-      gfc_error ("Symbol '%s' present on multiple clauses at %L",
-                n->sym->name, &code->loc);
-    else
-      n->sym->mark = 1;
-
+    {
+      if (n->sym->mark)
+       gfc_error ("Symbol '%s' present on multiple clauses at %L",
+                  n->sym->name, &code->loc);
+      else
+       n->sym->mark = 1;
+    }
   for (list = 0; list < OMP_LIST_NUM; list++)
     if ((n = omp_clauses->lists[list]) != NULL)
       {