From 81f904895e839b19091832bb83f353d2f4963939 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 17 Sep 2020 23:33:41 +0100 Subject: [PATCH] gdb.mi/var-cmd.c C++ify This adjusts gdb.mi/var-cmd.c to make it buildable as a C++ program. gdb/testsuite/ChangeLog: * gdb.mi/var-cmd.c (do_anonymous_type_tests): Add cast. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.mi/var-cmd.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index a97ac09c5e0..75a4c2d367c 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-09-17 Pedro Alves + + * gdb.mi/var-cmd.c (do_anonymous_type_tests): Add cast. + 2020-09-17 Pedro Alves * gdb.base/exprs.c: Replace 'this' with 'self' throughout. diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c index 0529b67c7f1..f209106dd65 100644 --- a/gdb/testsuite/gdb.mi/var-cmd.c +++ b/gdb/testsuite/gdb.mi/var-cmd.c @@ -566,7 +566,7 @@ do_anonymous_type_tests (void) }; } v = {1, {2}, {3}}; - anon = malloc (sizeof (struct anonymous)); + anon = (struct anonymous *) malloc (sizeof (struct anonymous)); anon->a = 1; anon->b = 2; anon->c = (char *) 3; -- 2.30.2