From: Pedro Alves Date: Thu, 17 Sep 2020 22:33:43 +0000 (+0100) Subject: gdb.base/sizeof.exp C++ify X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ef0cdbc16f4909d667497691f456d15c7dc7cdba;p=binutils-gdb.git 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. --- 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];