[RFC,11/18] gdb.python/{py-framefilter-mi,py-framefilter}.c C++ify

Message ID 20200914001437.31157-12-pedro@palves.net
State New
Headers show
Series
  • Allow building (more) C tests with a C++ compiler
Related show

Commit Message

Pedro Alves Sept. 14, 2020, 12:14 a.m.
This adjusts:

 gdb.python/{py-framefilter-mi,py-framefilter}.c

to make them buildable as C++ programs.
---
 gdb/testsuite/gdb.python/py-framefilter-mi.c | 4 ++--
 gdb/testsuite/gdb.python/py-framefilter.c    | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.14.5

Patch

diff --git a/gdb/testsuite/gdb.python/py-framefilter-mi.c b/gdb/testsuite/gdb.python/py-framefilter-mi.c
index 10779069d58..bc2ad1e4a05 100644
--- a/gdb/testsuite/gdb.python/py-framefilter-mi.c
+++ b/gdb/testsuite/gdb.python/py-framefilter-mi.c
@@ -83,8 +83,8 @@  void funca(void)
   fb.f = 42;
   fb.s = 19;
 
-  bf = malloc (sizeof (foobar));
-  bf->nothing = malloc (128);
+  bf = (foobar *) malloc (sizeof (foobar));
+  bf->nothing = (char *) malloc (128);
   bf->nothing = "Bar Foo";
   bf->f = 24;
   bf->s = 91;
diff --git a/gdb/testsuite/gdb.python/py-framefilter.c b/gdb/testsuite/gdb.python/py-framefilter.c
index d98005f0e46..675a0c5ac99 100644
--- a/gdb/testsuite/gdb.python/py-framefilter.c
+++ b/gdb/testsuite/gdb.python/py-framefilter.c
@@ -84,8 +84,8 @@  void funca(void)
   fb.f = 42;
   fb.s = 19;
 
-  bf = alloca (sizeof (foobar));
-  bf->nothing = alloca (128);
+  bf = (foobar *) alloca (sizeof (foobar));
+  bf->nothing = (char *) alloca (128);
   bf->nothing = "Bar Foo";
   bf->f = 24;
   bf->s = 91;
@@ -112,8 +112,8 @@  int func2(int f)
   fb.f = 84;
   fb.s = 38;
 
-  bf = alloca (sizeof (foobar));
-  bf->nothing = alloca (128);
+  bf = (foobar *) alloca (sizeof (foobar));
+  bf->nothing = (char *) alloca (128);
   bf->nothing = "Elided Bar Foo";
   bf->f = 48;
   bf->s = 182;