Re: New ARI warning Wed Oct 2 01:56:22 UTC 2019

Simon Marchi
2019-10-02T17:30:41Z

On 2019-10-02 12:15 p.m., Tom Tromey wrote:
> diff --git a/gdb/contrib/ari/gdb_ari.sh b/gdb/contrib/ari/gdb_ari.sh
> index 4bd434c8fec..1556756a12c 100755
> --- a/gdb/contrib/ari/gdb_ari.sh
> +++ b/gdb/contrib/ari/gdb_ari.sh
> @@ -353,7 +353,7 @@ Do not use printf(\"%p\"), instead use printf(\"%s\",paddr()) to dump a \
> target address, or host_address_to_string() for a host address"
> category["%p"] = ari_code
> }
> -/%p/ && !/%prec/ {
> +/%p[^][sF]/ && !/%prec/ {
> fail("%p")
> }
>

My mind is a bit confused by that regex: aren't the [^] and [sF] considered
as two successive character sets? If so, the caret character, which negates
the character set, applies to nothing.

Shouldn't there be some escaping involved? Or is the language smart enough
to know that because the first ] wouldn't end a valid character set, it means
it's not actually the end of the character set?

Simon