[PATCH] Make out of range type conversions explicit

Gary Benson gbenson@redhat.com
Fri Jul 3 09:30:18 GMT 2020


Pedro Alves wrote:
> diff --git a/gdb/testsuite/gdb.base/structs2.c b/gdb/testsuite/gdb.base/structs2.c
> index 7c8be035221..aac7bce8c15 100644
> --- a/gdb/testsuite/gdb.base/structs2.c
> +++ b/gdb/testsuite/gdb.base/structs2.c
> @@ -13,7 +13,7 @@ main ()
>  
>    bkpt = 0;
>    param_reg (120, 130, 32000, 33000);
> -  param_reg (130, 120, 33000, 32000);
> +  param_reg (-120, 130, -32000, 33000);
>  
>    return 0;
>  }

On first glance I thought this was a copy-paste error.  I don't think
it is, but, just in case, can you confirm the change above is what you
intended?

> diff --git a/gdb/testsuite/gdb.base/structs2.exp b/gdb/testsuite/gdb.base/structs2.exp
> index 8a7d9c69378..5722be3109c 100644
> --- a/gdb/testsuite/gdb.base/structs2.exp
> +++ b/gdb/testsuite/gdb.base/structs2.exp
> @@ -49,5 +49,5 @@ if [test_compiler_info gcc-3-*] {
>    setup_xfail hppa*-* gcc/15860
>  }
>  gdb_test "continue" \
> -    ".*pr_char=-126.*pr_uchar=120.*pr_short=-32536.*pr_ushort=32000.*bkpt = 1.*" \
> +    ".*pr_char=-120.*pr_uchar=130.*pr_short=-32000.*pr_ushort=33000.*bkpt = 1.*" \
>      "structs2 continue2"

-- 
Gary Benson - he / him / his
Principal Software Engineer, Red Hat



More information about the Gdb-patches mailing list