Avoid unfounded warnings from GCC 7.2.
[pspp] / src / language / stats / descriptives.c
index 1ffe861552b6aaae990816bb08097a2e4db7f617..11a9f7f31e50fad3bf8fe540a046c9af57eaadd4 100644 (file)
@@ -284,7 +284,15 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds)
               else if (lex_match_id (lexer, "DEFAULT"))
                 dsc->show_stats |= DEFAULT_STATS;
               else
-               dsc->show_stats |= 1ul << (match_statistic (lexer));
+               {
+                 enum dsc_statistic s = match_statistic (lexer);
+                 if (s == DSC_NONE )
+                   {
+                     lex_error (lexer, NULL);
+                     goto error;
+                   }
+                 dsc->show_stats |= 1ul << s;
+               }
               lex_match (lexer, T_COMMA);
             }
           if (dsc->show_stats == 0)
@@ -309,7 +317,8 @@ cmd_descriptives (struct lexer *lexer, struct dataset *ds)
                 dsc->sort_ascending = 0;
               else
                 lex_error (lexer, NULL);
-              lex_force_match (lexer, T_RPAREN);
+              if (! lex_force_match (lexer, T_RPAREN))
+               goto error;
             }
         }
       else if (var_cnt == 0)
@@ -549,7 +558,7 @@ generate_z_varname (const struct dictionary *dict, struct dsc_proc *dsc,
   /* Generate a synthetic name. */
   for (;;)
     {
-      char name[8];
+      char name[16];
 
       (*z_cnt)++;