[binutils-gdb] gdb.mi/var-cmd.c C++ify

Pedro Alves palves@sourceware.org
Thu Sep 17 23:11:56 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=81f904895e839b19091832bb83f353d2f4963939

commit 81f904895e839b19091832bb83f353d2f4963939
Author: Pedro Alves <pedro@palves.net>
Date:   Thu Sep 17 23:33:41 2020 +0100

    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.

Diff:
---
 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  <pedro@palves.net>
+
+	* gdb.mi/var-cmd.c (do_anonymous_type_tests): Add cast.
+
 2020-09-17  Pedro Alves  <pedro@palves.net>
 
 	* 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;


More information about the Gdb-cvs mailing list