From ef0cdbc16f4909d667497691f456d15c7dc7cdba Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 17 Sep 2020 23:33:43 +0100 Subject: [PATCH] gdb.base/sizeof.exp C++ify Fixes: src/gdb/testsuite/gdb.base/sizeof.c:54:9: error: cannot initialize a variable of type 'char *' with an lvalue of type 'void *' ... when the testcase is built with a C++ compiler. gdb/testsuite/ChangeLog: * gdb.base/sizeof.c (fill): Add cast. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/sizeof.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4ecee4bcefd..db141589fcb 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2020-09-17 Pedro Alves + + * gdb.base/sizeof.c (fill): Add cast. + 2020-09-17 Pedro Alves * gdb.base/share-env-with-gdbserver.c (main): Add cast. 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]; -- 2.30.2