This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] [5/6 Regression] Line continuation followed by comment character in string fails to compile
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 17 May 2015 07:43:28 -0700
- Subject: Re: [patch, fortran] [5/6 Regression] Line continuation followed by comment character in string fails to compile
- Authentication-results: sourceware.org; auth=none
- References: <55540130 dot 5080206 at charter dot net> <555759B6 dot 1070901 at charter dot net> <20150516151156 dot GA89083 at troutmask dot apl dot washington dot edu> <55578226 dot 60701 at charter dot net> <5557A15D dot 3020205 at charter dot net>
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)
>
>
>
>
>