Re: [PATCH] Fix "list" when control characters are seen

Andreas Schwab
2019-04-09T19:24:53Z

On Apr 09 2019, Tom Tromey <tromey@adacore.com> wrote:

> diff --git a/gdb/source.c b/gdb/source.c
> index f99215f9810..b61880ab503 100644
> --- a/gdb/source.c
> +++ b/gdb/source.c
> @@ -1368,7 +1368,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline,
> char c = *iter;
> if (c == '\033' && skip_ansi_escape (iter, &skip_bytes))
> iter += skip_bytes;
> - else if (c < 040 && c != '\t')
> + else if (c >= 0 && c < 040 && c != '\t')

Does this give a warning when char is unsigned?

Andreas.

--
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."