On Mai 04 2022, Martin Liška wrote:

> diff --git a/gcc/gengtype-state.cc b/gcc/gengtype-state.cc
> index ea566af3249..dfd9ea52785 100644
> --- a/gcc/gengtype-state.cc
> +++ b/gcc/gengtype-state.cc
> @@ -473,43 +473,43 @@ read_a_state_token (void)
>               {
>               case 'a':
>                 obstack_1grow (&bstring_obstack, '\a');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 'b':
>                 obstack_1grow (&bstring_obstack, '\b');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 't':
>                 obstack_1grow (&bstring_obstack, '\t');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 'n':
>                 obstack_1grow (&bstring_obstack, '\n');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 'v':
>                 obstack_1grow (&bstring_obstack, '\v');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 'f':
>                 obstack_1grow (&bstring_obstack, '\f');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case 'r':
>                 obstack_1grow (&bstring_obstack, '\r');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case '"':
>                 obstack_1grow (&bstring_obstack, '\"');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case '\\':
>                 obstack_1grow (&bstring_obstack, '\\');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;
>               case ' ':
>                 obstack_1grow (&bstring_obstack, ' ');
> -               c = getc (state_file);
> +               getc (state_file);
>                 break;

This is surprising.  Does that mean that an escape sequence must always
be followed by a character that is thrown away?
state_writer::write_state_a_string surely doesn't suggest that.  I
suspect that this part of the code has never been exercised.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

Reply via email to