On Tue, Oct 10, 2017 at 07:42:25PM +0200, Thomas Koenig wrote:
> Hello world,
> 
> the attached patch displays an error for characters which are
> outside the normal Fortran character set, and includes a hex

If this              ^^^^^^^^^^^^^^^^^^^^^

> code when it is not printable.
> 
> gfortran 4.9 did display unprintable characters in the file,
> so it might be argued that this bug is a regression.
> 
> Regression-tested. OK for trunk? What do people feel about backporting?
> 
> Regards
> 
>       Thomas
> 
> 2017-10-10  Thomas Koenig  <tkoe...@gcc.gnu.org>
> 
>          PR fortran/82372
>          * fortran/scanner.c (valid_chars): String with all characters
>          which could be valid in Fortran.

corresponds to this statement,

>          (valid_table):  Boolean table to select valid characters.
>          (gfc_scanner_init_1): Set up valid_table from vaid_chars.
>          (gfc_gooble_whitespace): If a character not in the Fortran
>          character set appears, display error.
> 
> 2017-10-10  Thomas Koenig  <tkoe...@gcc.gnu.org>
> 
>          PR fortran/82372
>          * gfortran.dg/illegal_char.f90: New test.

> Index: fortran/scanner.c
> ===================================================================
> --- fortran/scanner.c (Revision 253530)
> +++ fortran/scanner.c (Arbeitskopie)
> @@ -80,7 +80,14 @@ static struct gfc_file_change
>  size_t file_changes_cur, file_changes_count;
>  size_t file_changes_allocated;
>  
> +char valid_chars[] =
> +  "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
> +  "=+*-/^%[].,\n\t\r'\"();:<>_!$&0123456789";

then this is not correct.  From F2003, letters, digits, 
underscore, and special characters (see Table 3.1) are
members of the Fortran character set.  Your string includes
\n, \t, and \r, which are not in the Fortran character set.
Your string is missing \, {, }, ~, `, |, #, and @.

-- 
Steve
20170425 https://www.youtube.com/watch?v=VWUpyCsUKR4
20161221 https://www.youtube.com/watch?v=IbCHE-hONow

Reply via email to