[RFC,15/18] gdb.base/sizeof.exp C++ify

Message ID 20200914001437.31157-16-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.
Fixes:
  src/gdb/testsuite/gdb.base/sizeof.c:54:9: error: cannot initialize a variable of type 'char *' with an lvalue of type 'void *'
---
 gdb/testsuite/gdb.base/sizeof.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.14.5

Patch

diff --git a/gdb/testsuite/gdb.base/sizeof.c b/gdb/testsuite/gdb.base/sizeof.c
index fde52139ef8..4cf8c55898b 100644
--- a/gdb/testsuite/gdb.base/sizeof.c
+++ b/gdb/testsuite/gdb.base/sizeof.c
@@ -51,7 +51,7 @@  struct {
 static void
 fill (void *buf, long sizeof_buf)
 {
-  char *p = buf;
+  char *p = (char *) buf;
   int i;
   for (i = 0; i < sizeof_buf; i++)
     p[i] = "The quick brown dingo jumped over the layzy dog."[i];