[Patch, Fortran] PR 50109 - fix skipping multiple comment lines in namelists

Tobias Burnus burnus@net-b.de
Thu Aug 18 10:21:00 GMT 2011


On 08/18/2011 11:59 AM, Tobias Burnus wrote:
> The patch should be rather simple and self explaining.

I just realized that I forgot to add more context to the diff. Thus, 
below the patch itself with some more lines (copied from 
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50109#c4).

Without, it looks less obvious than it actually is.

One simply jumps again to the top of the "do { } while()" after removing 
the "!" line. The LIBERROR_END check is superfluous as it is already 
tested when moving to the top of "do {".

I was thinking of using "continue" or goto next, but the former will 
still check the while() condition and I think the latter looks more 
complicated/cluttered than the "c='\n';".

Tobias

@@ -345,28 +345,19 @@ eat_separator (st_parameter_dt *dtp)
           do
             {
               if ((c = next_char (dtp)) == EOF)
                   return LIBERROR_END;
               if (c == '!')
                 {
                   err = eat_line (dtp);
                   if (err)
                     return err;
-                 if ((c = next_char (dtp)) == EOF)
-                   return LIBERROR_END;
-                 if (c == '!')
-                   {
-                     err = eat_line (dtp);
-                     if (err)
-                       return err;
-                     if ((c = next_char (dtp)) == EOF)
-                       return LIBERROR_END;
-                   }
+                 c = '\n';
                 }
             }
           while (c == '\n' || c == '\r' || c == ' ' || c == '\t');
           unget_char (dtp, c);



More information about the Fortran mailing list