http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46705

--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2010-12-11 
20:41:52 UTC ---
I think this does the trick for the original and a few variations.  I would
like to use an enumerator rather than 0 , 1, and 2 for the in_string flag. 
That will touch a few more places, but will make the code more readable.

Index: scanner.c
===================================================================
--- scanner.c    (revision 167711)
+++ scanner.c    (working copy)
@@ -1146,10 +1146,10 @@ restart:
     {
       if (in_string)
         {
-          if (gfc_option.warn_ampersand)
-        gfc_warning_now ("Missing '&' in continued character "
-                 "constant at %C");
           gfc_current_locus.nextc--;
+          if (gfc_option.warn_ampersand && in_string == 1)
+        gfc_warning ("Missing '&' in continued character "
+                 "constant at %C");
         }
       /* Both !$omp and !$ -fopenmp continuation lines have & on the
          continuation line only optionally.  */
Index: io.c
===================================================================
--- io.c    (revision 167711)
+++ io.c    (working copy)
@@ -383,7 +383,7 @@ format_lex (void)

       if (c == delim)
         {
-          c = next_char (1);
+          c = next_char (2);

           if (c == '\0')
         {

Reply via email to