public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: "Martin Liška" <mliska@suse.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH][pushed] Remove dead code.
Date: Wed, 04 May 2022 15:20:50 +0200	[thread overview]
Message-ID: <8735hpqvrh.fsf@igel.home> (raw)
In-Reply-To: <53a19169-b79a-742e-6646-18aff8ce65d5@suse.cz> ("Martin =?utf-8?Q?Li=C5=A1ka=22's?= message of "Wed, 4 May 2022 14:49:24 +0200")

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, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."

  reply	other threads:[~2022-05-04 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-04 12:49 Martin Liška
2022-05-04 13:20 ` Andreas Schwab [this message]
2022-05-04 14:20   ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8735hpqvrh.fsf@igel.home \
    --to=schwab@linux-m68k.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).