[RFC 10/18] gdb.mi/var-cmd.c C++ify

Pedro Alves pedro@palves.net
Mon Sep 14 00:14:29 GMT 2020


This adjusts gdb.mi/var-cmd.c to make it buildable as a C++ program.
---
 gdb/testsuite/gdb.mi/var-cmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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



More information about the Gdb-patches mailing list