diff mbox

[fortran,5/6,Regression] Line continuation followed by comment character in string fails to compile

Message ID 5557A15D.3020205@charter.net
State New
Headers show

Commit Message

Jerry DeLisle May 16, 2015, 7:58 p.m. UTC
On 05/16/2015 10:45 AM, Jerry DeLisle wrote:
--- snip ---

> Thanks Steve,
> 
> Committed revision 223248.
> 
> 

I had some time to play with this a little more this afternoon.

I am going to commit the following little patchlet that gives us the nice
warning we should have. (After full regression testing of course)

gfc -Wall continuation_13.f90
continuation_13.f90:22:4: Warning: Missing ‘&’ in continued character constant
at (1) [-Wampersand]
continuation_13.f90:24:4: Warning: Missing ‘&’ in continued character constant
at (1) [-Wampersand]

Comments

Jerry DeLisle May 17, 2015, 2:43 p.m. UTC | #1
On 05/16/2015 12:58 PM, Jerry DeLisle wrote:
> On 05/16/2015 10:45 AM, Jerry DeLisle wrote:
> --- snip ---
> 
>> Thanks Steve,
>>
>> Committed revision 223248.
>>
>>
> 
> I had some time to play with this a little more this afternoon.
> 
> I am going to commit the following little patchlet that gives us the nice
> warning we should have. (After full regression testing of course)

I changed my mind.  Adding this warning affects 22 test cases. Question for the
team.

Do we want this warning? If so, I will have to adjust each of the 22.

Jerry

> 
> gfc -Wall continuation_13.f90
> continuation_13.f90:22:4: Warning: Missing ‘&’ in continued character constant
> at (1) [-Wampersand]
> continuation_13.f90:24:4: Warning: Missing ‘&’ in continued character constant
> at (1) [-Wampersand]
> 
> 
> Index: scanner.c
> ===================================================================
> --- scanner.c	(revision 223250)
> +++ scanner.c	(working copy)
> @@ -1383,7 +1383,12 @@
>  			     "constant at %C");
>  	    }
>  	  else if (!in_string && (c == '\'' || c == '"'))
> +	    {
> +	      gfc_warning (OPT_Wampersand,
> +			     "Missing %<&%> in continued character "
> +			     "constant at %C");
>  	      goto done;
> +	    }
>  	  /* Both !$omp and !$ -fopenmp continuation lines have & on the
>  	     continuation line only optionally.  */
>  	  else if (openmp_flag || openacc_flag || openmp_cond_flag)
> 
> 
> 
> 
>
diff mbox

Patch

Index: scanner.c
===================================================================
--- scanner.c	(revision 223250)
+++ scanner.c	(working copy)
@@ -1383,7 +1383,12 @@ 
 			     "constant at %C");
 	    }
 	  else if (!in_string && (c == '\'' || c == '"'))
+	    {
+	      gfc_warning (OPT_Wampersand,
+			     "Missing %<&%> in continued character "
+			     "constant at %C");
 	      goto done;
+	    }
 	  /* Both !$omp and !$ -fopenmp continuation lines have & on the
 	     continuation line only optionally.  */
 	  else if (openmp_flag || openacc_flag || openmp_cond_flag)